changeset 13982:ba50bcff7726

Merge
author lana
date Thu, 31 Mar 2016 09:00:24 -0700
parents 0c17d24c43b6 d7a4b04e3fc9
children b312c746bd94
files make/src/classes/build/tools/module/Module.java make/src/classes/build/tools/module/ModuleInfoReader.java make/src/classes/build/tools/module/ModulesXmlReader.java make/src/classes/build/tools/module/ModulesXmlWriter.java src/java.base/share/classes/sun/misc/InvalidJarIndexException.java src/java.base/share/classes/sun/misc/JarIndex.java src/java.base/share/classes/sun/misc/resources/Messages.java src/java.base/share/classes/sun/misc/resources/Messages_de.java src/java.base/share/classes/sun/misc/resources/Messages_es.java src/java.base/share/classes/sun/misc/resources/Messages_fr.java src/java.base/share/classes/sun/misc/resources/Messages_it.java src/java.base/share/classes/sun/misc/resources/Messages_ja.java src/java.base/share/classes/sun/misc/resources/Messages_ko.java src/java.base/share/classes/sun/misc/resources/Messages_pt_BR.java src/java.base/share/classes/sun/misc/resources/Messages_sv.java src/java.base/share/classes/sun/misc/resources/Messages_zh_CN.java src/java.base/share/classes/sun/misc/resources/Messages_zh_TW.java
diffstat 466 files changed, 85957 insertions(+), 2760 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Thu Mar 31 01:13:26 2016 -0700
+++ b/.hgignore	Thu Mar 31 09:00:24 2016 -0700
@@ -7,3 +7,5 @@
 ^make/netbeans/.*/dist/
 ^.hgtip
 .DS_Store
+.*/JTreport/.*
+.*/JTwork/.*
--- a/make/gensrc/Gensrc-java.base.gmk	Thu Mar 31 01:13:26 2016 -0700
+++ b/make/gensrc/Gensrc-java.base.gmk	Thu Mar 31 09:00:24 2016 -0700
@@ -55,7 +55,6 @@
 # copied to zh_HK locale.
 $(eval $(call SetupCopy-zh_HK,COPY_ZH_HK, \
     $(addprefix $(JDK_TOPDIR)/src/java.base/share/classes/, \
-        sun/misc/resources/Messages_zh_TW.java \
         sun/security/util/AuthResources_zh_TW.java \
         sun/security/util/Resources_zh_TW.java)))
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/netbeans/client_sanity/README	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,15 @@
+This NetBeans project corresponds to client sanity test suite in jdk/test/sanity/client.
+
+It simplifies working on the suite in NetBeans.
+
+It also includes the following custom tasks:
+
+prepare-bundle      creates dist/sanity.zip containing standalone bundle of the suite
+
+run-jemmy-browser   runs Jemmy browser for the ButtonDemo (hardcoded in build.xml file)
+                    The tool allows to explore the UI hierarchy.
+                    
+There is no task to run tests using JTReg. Please refer to corresponding README file 
+in the client sanity test suite folder on how to run the tests.
+
+Contact alexander.kouznetsov@oracle.com in case of issues.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/netbeans/client_sanity/build.xml	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<!-- By default, only the Clean and Build commands use this build script. -->
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
+<!-- the Compile on Save feature is turned off for the project. -->
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
+<!-- in the project's Project Properties dialog box.-->
+<project name="SanityTests" default="default" basedir=".">
+    <description>Builds, tests, and runs the project SanityTests.</description>
+    <import file="nbproject/build-impl.xml"/>
+    <!--
+
+    There exist several targets which are by default empty and which can be 
+    used for execution of your tasks. These targets are usually executed 
+    before and after some main targets. They are: 
+
+      -pre-init:                 called before initialization of project properties
+      -post-init:                called after initialization of project properties
+      -pre-compile:              called before javac compilation
+      -post-compile:             called after javac compilation
+      -pre-compile-single:       called before javac compilation of single file
+      -post-compile-single:      called after javac compilation of single file
+      -pre-compile-test:         called before javac compilation of JUnit tests
+      -post-compile-test:        called after javac compilation of JUnit tests
+      -pre-compile-test-single:  called before javac compilation of single JUnit test
+      -post-compile-test-single: called after javac compilation of single JUunit test
+      -pre-jar:                  called before JAR building
+      -post-jar:                 called after JAR building
+      -post-clean:               called after cleaning build products
+
+    (Targets beginning with '-' are not intended to be called on their own.)
+
+    Example of inserting an obfuscator after compilation could look like this:
+
+        <target name="-post-compile">
+            <obfuscate>
+                <fileset dir="${build.classes.dir}"/>
+            </obfuscate>
+        </target>
+
+    For list of available properties check the imported 
+    nbproject/build-impl.xml file. 
+
+
+    Another way to customize the build is by overriding existing main targets.
+    The targets of interest are: 
+
+      -init-macrodef-javac:     defines macro for javac compilation
+      -init-macrodef-junit:     defines macro for junit execution
+      -init-macrodef-debug:     defines macro for class debugging
+      -init-macrodef-java:      defines macro for class execution
+      -do-jar:                  JAR building
+      run:                      execution of project 
+      -javadoc-build:           Javadoc generation
+      test-report:              JUnit report generation
+
+    An example of overriding the target for project execution could look like this:
+
+        <target name="run" depends="SanityTests-impl.jar">
+            <exec dir="bin" executable="launcher.exe">
+                <arg file="${dist.jar}"/>
+            </exec>
+        </target>
+
+    Notice that the overridden target depends on the jar target and not only on 
+    the compile target as the regular run target does. Again, for a list of available 
+    properties which you can use, check the target you are overriding in the
+    nbproject/build-impl.xml file. 
+
+    -->
+    
+    <target name="prepare-bundle" depends="init">
+        <zip zipfile="${dist.dir}/sanity.zip">
+            <fileset dir="../../../test" includes="sanity/client/SwingSet/**"/>
+            <fileset dir="../../../test" includes="sanity/client/lib/**"/>
+            <fileset dir="../../../test" includes="sanity/client/ReadMe.txt"/>
+            <fileset dir="../../../test" includes="sanity/client/TEST.properties"/>            
+            <mappedresources>
+                <fileset dir="../../../test/sanity/client" includes="TEST.ROOT.template"/>
+                <globmapper from="TEST.ROOT.template" to="TEST.ROOT" />
+            </mappedresources>            
+        </zip>
+    </target>
+    
+    <target name="run-jemmy-browser" depends="init">
+        <java 
+            classpath="${run.classpath}"
+            classname="org.netbeans.jemmy.explorer.GUIBrowser" 
+            args="com.sun.swingset3.demos.button.ButtonDemo"/>
+    </target>
+    
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/netbeans/client_sanity/manifest.mf	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/netbeans/client_sanity/nbproject/build-impl.xml	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,1429 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+  - initialization
+  - compilation
+  - jar
+  - execution
+  - debugging
+  - javadoc
+  - test compilation
+  - test execution
+  - test debugging
+  - applet
+  - cleanup
+
+        -->
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="SanityTests-impl">
+    <fail message="Please build using Ant 1.8.0 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.8.0"/>
+            </not>
+        </condition>
+    </fail>
+    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
+    <!-- 
+                ======================
+                INITIALIZATION SECTION 
+                ======================
+            -->
+    <target name="-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init" name="-init-private">
+        <property file="nbproject/private/config.properties"/>
+        <property file="nbproject/private/configs/${config}.properties"/>
+        <property file="nbproject/private/private.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private" name="-init-user">
+        <property file="${user.properties.file}"/>
+        <!-- The two properties below are usually overridden -->
+        <!-- by the active platform. Just a fallback. -->
+        <property name="default.javac.source" value="1.4"/>
+        <property name="default.javac.target" value="1.4"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user" name="-init-project">
+        <property file="nbproject/configs/${config}.properties"/>
+        <property file="nbproject/project.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+        <property name="platform.java" value="${java.home}/bin/java"/>
+        <available file="${manifest.file}" property="manifest.available"/>
+        <condition property="splashscreen.available">
+            <and>
+                <not>
+                    <equals arg1="${application.splash}" arg2="" trim="true"/>
+                </not>
+                <available file="${application.splash}"/>
+            </and>
+        </condition>
+        <condition property="main.class.available">
+            <and>
+                <isset property="main.class"/>
+                <not>
+                    <equals arg1="${main.class}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="profile.available">
+            <and>
+                <isset property="javac.profile"/>
+                <length length="0" string="${javac.profile}" when="greater"/>
+                <matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
+            </and>
+        </condition>
+        <condition property="do.archive">
+            <or>
+                <not>
+                    <istrue value="${jar.archive.disabled}"/>
+                </not>
+                <istrue value="${not.archive.disabled}"/>
+            </or>
+        </condition>
+        <condition property="do.mkdist">
+            <and>
+                <isset property="do.archive"/>
+                <isset property="libs.CopyLibs.classpath"/>
+                <not>
+                    <istrue value="${mkdist.disabled}"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available">
+            <and>
+                <isset property="manifest.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+main.class.available">
+            <and>
+                <isset property="main.class.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+splashscreen.available">
+            <and>
+                <isset property="splashscreen.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+profile.available">
+            <and>
+                <isset property="profile.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="have.tests">
+            <or/>
+        </condition>
+        <condition property="have.sources">
+            <or>
+                <available file="${src.src3.dir}"/>
+                <available file="${src.src4.dir}"/>
+                <available file="${src.src2.dir}"/>
+                <available file="${src.src.dir}"/>
+            </or>
+        </condition>
+        <condition property="netbeans.home+have.tests">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="have.tests"/>
+            </and>
+        </condition>
+        <condition property="no.javadoc.preview">
+            <and>
+                <isset property="javadoc.preview"/>
+                <isfalse value="${javadoc.preview}"/>
+            </and>
+        </condition>
+        <property name="run.jvmargs" value=""/>
+        <property name="run.jvmargs.ide" value=""/>
+        <property name="javac.compilerargs" value=""/>
+        <property name="work.dir" value="${basedir}"/>
+        <condition property="no.deps">
+            <and>
+                <istrue value="${no.dependencies}"/>
+            </and>
+        </condition>
+        <property name="javac.debug" value="true"/>
+        <property name="javadoc.preview" value="true"/>
+        <property name="application.args" value=""/>
+        <property name="source.encoding" value="${file.encoding}"/>
+        <property name="runtime.encoding" value="${source.encoding}"/>
+        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+            <and>
+                <isset property="javadoc.encoding"/>
+                <not>
+                    <equals arg1="${javadoc.encoding}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <property name="javadoc.encoding.used" value="${source.encoding}"/>
+        <property name="includes" value="**"/>
+        <property name="excludes" value=""/>
+        <property name="do.depend" value="false"/>
+        <condition property="do.depend.true">
+            <istrue value="${do.depend}"/>
+        </condition>
+        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+            <and>
+                <isset property="endorsed.classpath"/>
+                <not>
+                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
+            <isset property="profile.available"/>
+        </condition>
+        <condition else="false" property="jdkBug6558476">
+            <and>
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>
+                <not>
+                    <os family="unix"/>
+                </not>
+            </and>
+        </condition>
+        <condition else="false" property="javac.fork">
+            <or>
+                <istrue value="${jdkBug6558476}"/>
+                <istrue value="${javac.external.vm}"/>
+            </or>
+        </condition>
+        <property name="jar.index" value="false"/>
+        <property name="jar.index.metainf" value="${jar.index}"/>
+        <property name="copylibs.rebase" value="true"/>
+        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
+        <condition property="junit.available">
+            <or>
+                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
+                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
+            </or>
+        </condition>
+        <condition property="testng.available">
+            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
+        </condition>
+        <condition property="junit+testng.available">
+            <and>
+                <istrue value="${junit.available}"/>
+                <istrue value="${testng.available}"/>
+            </and>
+        </condition>
+        <condition else="testng" property="testng.mode" value="mixed">
+            <istrue value="${junit+testng.available}"/>
+        </condition>
+        <condition else="" property="testng.debug.mode" value="-mixed">
+            <istrue value="${junit+testng.available}"/>
+        </condition>
+        <property name="java.failonerror" value="true"/>
+    </target>
+    <target name="-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+        <fail unless="src.src3.dir">Must set src.src3.dir</fail>
+        <fail unless="src.src4.dir">Must set src.src4.dir</fail>
+        <fail unless="src.src2.dir">Must set src.src2.dir</fail>
+        <fail unless="src.src.dir">Must set src.src.dir</fail>
+        <fail unless="build.dir">Must set build.dir</fail>
+        <fail unless="dist.dir">Must set dist.dir</fail>
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+        <fail unless="dist.jar">Must set dist.jar</fail>
+    </target>
+    <target name="-init-macrodef-property">
+        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${@{value}}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.src3.dir}:${src.src4.dir}:${src.src2.dir}:${src.src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <mkdir dir="@{apgeneratedsrcdir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <compilerarg value="-processorpath"/>
+                    <compilerarg path="@{processorpath}:${empty.dir}"/>
+                    <compilerarg line="${ap.processors.internal}"/>
+                    <compilerarg line="${annotation.processing.processor.options}"/>
+                    <compilerarg value="-s"/>
+                    <compilerarg path="@{apgeneratedsrcdir}"/>
+                    <compilerarg line="${ap.proc.none.internal}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.src3.dir}:${src.src4.dir}:${src.src2.dir}:${src.src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
+        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.src3.dir}:${src.src4.dir}:${src.src2.dir}:${src.src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <sequential>
+                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </depend>
+            </sequential>
+        </macrodef>
+        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <sequential>
+                <fail unless="javac.includes">Must set javac.includes</fail>
+                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
+                    <path>
+                        <filelist dir="@{destdir}" files="${javac.includes}"/>
+                    </path>
+                    <globmapper from="*.java" to="*.class"/>
+                </pathconvert>
+                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
+                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
+                <delete>
+                    <files includesfile="${javac.includesfile.binary}"/>
+                </delete>
+                <delete>
+                    <fileset file="${javac.includesfile.binary}"/>
+                </delete>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${junit.available}" name="-init-macrodef-junit-init">
+        <condition else="false" property="nb.junit.batch" value="true">
+            <and>
+                <istrue value="${junit.available}"/>
+                <not>
+                    <isset property="test.method"/>
+                </not>
+            </and>
+        </condition>
+        <condition else="false" property="nb.junit.single" value="true">
+            <and>
+                <istrue value="${junit.available}"/>
+                <isset property="test.method"/>
+            </and>
+        </condition>
+    </target>
+    <target name="-init-test-properties">
+        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
+        <property name="test.binarytestincludes" value=""/>
+        <property name="test.binaryexcludes" value=""/>
+    </target>
+    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+                            <filename name="${test.binarytestincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
+    <target if="${testng.available}" name="-init-macrodef-testng">
+        <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
+                    <isset property="test.method"/>
+                </condition>
+                <union id="test.set"/>
+                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
+                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="SanityTests" testname="TestNG tests" workingDir="${work.dir}">
+                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
+                    <propertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </propertyset>
+                    <customize/>
+                </testng>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-test-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <echo>No tests executed.</echo>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </j2seproject3:junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </j2seproject3:testng>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
+        <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <sequential>
+                <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize>
+                        <classpath>
+                            <path path="${run.test.classpath}"/>
+                        </classpath>
+                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                        <jvmarg line="${run.jvmargs}"/>
+                        <jvmarg line="${run.jvmargs.ide}"/>
+                    </customize>
+                </j2seproject3:test-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
+        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
+        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+                            <filename name="${test.binarytestincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
+        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </j2seproject3:junit-debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${testng.available}" name="-init-macrodef-testng-debug">
+        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <element name="customize2" optional="true"/>
+            <sequential>
+                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
+                    <isset property="test.method"/>
+                </condition>
+                <condition else="-suitename SanityTests -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
+                    <matches pattern=".*\.xml" string="@{testClass}"/>
+                </condition>
+                <delete dir="${build.test.results.dir}" quiet="true"/>
+                <mkdir dir="${build.test.results.dir}"/>
+                <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
+                    <customize>
+                        <customize2/>
+                        <jvmarg value="-ea"/>
+                        <arg line="${testng.debug.mode}"/>
+                        <arg line="-d ${build.test.results.dir}"/>
+                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
+                        <arg line="${testng.cmd.args}"/>
+                    </customize>
+                </j2seproject3:debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
+        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <element implicit="true" name="customize2" optional="true"/>
+            <sequential>
+                <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
+                    <customize2/>
+                </j2seproject3:testng-debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
+        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <sequential>
+                <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize>
+                        <classpath>
+                            <path path="${run.test.classpath}"/>
+                        </classpath>
+                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                        <jvmarg line="${run.jvmargs}"/>
+                        <jvmarg line="${run.jvmargs.ide}"/>
+                    </customize>
+                </j2seproject3:test-debug-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
+        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <sequential>
+                <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
+                    <customize2>
+                        <syspropertyset>
+                            <propertyref prefix="test-sys-prop."/>
+                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                        </syspropertyset>
+                    </customize2>
+                </j2seproject3:testng-debug-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
+    <!--
+                pre NB7.2 profiling section; consider it deprecated
+            -->
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
+    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
+        <macrodef name="resolve">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${env.@{value}}"/>
+            </sequential>
+        </macrodef>
+        <macrodef name="profile">
+            <attribute default="${main.class}" name="classname"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property environment="env"/>
+                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
+                <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
+                    <jvmarg line="${profiler.info.jvmargs}"/>
+                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+                    <arg line="${application.args}"/>
+                    <classpath>
+                        <path path="${run.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
+    </target>
+    <!--
+                end of pre NB7.2 profiling section
+            -->
+    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="name"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <attribute default="" name="stopclassname"/>
+            <sequential>
+                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </nbjpdastart>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${build.classes.dir}" name="dir"/>
+            <sequential>
+                <nbjpdareload>
+                    <fileset dir="@{dir}" includes="${fix.classes}">
+                        <include name="${fix.includes}*.class"/>
+                    </fileset>
+                </nbjpdareload>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-debug-args">
+        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <condition property="have-jdk-older-than-1.4">
+            <or>
+                <contains string="${version-output}" substring="java version &quot;1.0"/>
+                <contains string="${version-output}" substring="java version &quot;1.1"/>
+                <contains string="${version-output}" substring="java version &quot;1.2"/>
+                <contains string="${version-output}" substring="java version &quot;1.3"/>
+            </or>
+        </condition>
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+            <istrue value="${have-jdk-older-than-1.4}"/>
+        </condition>
+        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+            <os family="windows"/>
+        </condition>
+        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+            <isset property="debug.transport"/>
+        </condition>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-debug">
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <jvmarg line="${run.jvmargs.ide}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-java">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${run.classpath}" name="classpath"/>
+            <attribute default="jvm" name="jvm"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <jvmarg line="${run.jvmargs.ide}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-copylibs">
+        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${manifest.file}" name="manifest"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+                <pathconvert property="run.classpath.without.build.classes.dir">
+                    <path path="${run.classpath}"/>
+                    <map from="${build.classes.dir.resolved}" to=""/>
+                </pathconvert>
+                <pathconvert pathsep=" " property="jar.classpath">
+                    <path path="${run.classpath.without.build.classes.dir}"/>
+                    <chainedmapper>
+                        <flattenmapper/>
+                        <filtermapper>
+                            <replacestring from=" " to="%20"/>
+                        </filtermapper>
+                        <globmapper from="*" to="lib/*"/>
+                    </chainedmapper>
+                </pathconvert>
+                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
+                    <manifest>
+                        <attribute name="Class-Path" value="${jar.classpath}"/>
+                        <customize/>
+                    </manifest>
+                </copylibs>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-presetdef-jar">
+        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
+                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
+            </jar>
+        </presetdef>
+    </target>
+    <target name="-init-ap-cmdline-properties">
+        <property name="annotation.processing.enabled" value="true"/>
+        <property name="annotation.processing.processors.list" value=""/>
+        <property name="annotation.processing.processor.options" value=""/>
+        <property name="annotation.processing.run.all.processors" value="true"/>
+        <property name="javac.processorpath" value="${javac.classpath}"/>
+        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
+        <condition property="ap.supported.internal" value="true">
+            <not>
+                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
+        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
+            <isfalse value="${annotation.processing.run.all.processors}"/>
+        </condition>
+        <condition else="" property="ap.proc.none.internal" value="-proc:none">
+            <isfalse value="${annotation.processing.enabled}"/>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
+        <property name="ap.cmd.line.internal" value=""/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
+    <!--
+                ===================
+                COMPILATION SECTION
+                ===================
+            -->
+    <target name="-deps-jar-init" unless="built-jar.properties">
+        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
+        <delete file="${built-jar.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
+        <echo level="warn" message="Cycle detected: SanityTests was already built"/>
+    </target>
+    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-jar.properties}" verbose="false"/>
+        <property file="${built-jar.properties}" prefix="already.built.jar."/>
+        <antcall target="-warn-already-built-jar"/>
+        <propertyfile file="${built-jar.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+    </target>
+    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
+    <target depends="init" name="-check-automatic-build">
+        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
+    </target>
+    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
+        <antcall target="clean"/>
+    </target>
+    <target depends="init,deps-jar" name="-pre-pre-compile">
+        <mkdir dir="${build.classes.dir}"/>
+    </target>
+    <target name="-pre-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-depend">
+        <pathconvert property="build.generated.subdirs">
+            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="*"/>
+            </dirset>
+        </pathconvert>
+        <j2seproject3:depend srcdir="${src.src3.dir}:${src.src4.dir}:${src.src2.dir}:${src.src.dir}:${build.generated.subdirs}"/>
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
+        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.src3.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.src4.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.src2.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target if="has.persistence.xml" name="-copy-persistence-xml">
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy todir="${build.classes.dir}/META-INF">
+            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
+        </copy>
+    </target>
+    <target name="-post-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+    <target name="-pre-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile/>
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.src3.dir}:${src.src4.dir}:${src.src2.dir}:${src.src.dir}"/>
+    </target>
+    <target name="-post-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+    <!--
+                ====================
+                JAR BUILDING SECTION
+                ====================
+            -->
+    <target depends="init" name="-pre-pre-jar">
+        <dirname file="${dist.jar}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+    </target>
+    <target name="-pre-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <touch file="${tmp.manifest.file}" verbose="false"/>
+    </target>
+    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
+    </target>
+    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="Main-Class" value="${main.class}"/>
+        </manifest>
+    </target>
+    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="Profile" value="${javac.profile}"/>
+        </manifest>
+    </target>
+    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
+        <basename file="${application.splash}" property="splashscreen.basename"/>
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
+        </manifest>
+    </target>
+    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
+        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
+        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <pathconvert property="run.classpath.with.dist.jar">
+            <path path="${run.classpath}"/>
+            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
+        </pathconvert>
+        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java} -cp ${run.classpath.with.dist.jar} ${main.class}">
+            <isset property="main.class.available"/>
+        </condition>
+        <condition else="debug" property="jar.usage.level" value="info">
+            <isset property="main.class.available"/>
+        </condition>
+        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
+    </target>
+    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
+        <delete>
+            <fileset file="${tmp.manifest.file}"/>
+        </delete>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
+    <target name="-post-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
+    <target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
+    <!--
+                =================
+                EXECUTION SECTION
+                =================
+            -->
+    <target depends="init,compile" description="Run a main class." name="run">
+        <j2seproject1:java>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <target name="-do-not-recompile">
+        <property name="javac.includes.binary" value=""/>
+    </target>
+    <target depends="init,compile-single" name="run-single">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}"/>
+    </target>
+    <target depends="init,compile-test-single" name="run-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+    </target>
+    <!--
+                =================
+                DEBUGGING SECTION
+                =================
+            -->
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+        <j2seproject1:nbjpdastart name="${debug.class}"/>
+    </target>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+    </target>
+    <target depends="init,compile" name="-debug-start-debuggee">
+        <j2seproject3:debug>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
+        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+    </target>
+    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}"/>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
+    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+    <target depends="init" name="-pre-debug-fix">
+        <fail unless="fix.includes">Must set fix.includes</fail>
+        <property name="javac.includes" value="${fix.includes}.java"/>
+    </target>
+    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+        <j2seproject1:nbjpdareload/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+    <!--
+                =================
+                PROFILING SECTION
+                =================
+            -->
+    <!--
+                pre NB7.2 profiler integration
+            -->
+    <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile/>
+    </target>
+    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
+        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="${profile.class}"/>
+    </target>
+    <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </profile>
+    </target>
+    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
+            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg line="${profiler.info.jvmargs}"/>
+            <test name="${profile.class}"/>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+            <syspropertyset>
+                <propertyref prefix="test-sys-prop."/>
+                <mapper from="test-sys-prop.*" to="*" type="glob"/>
+            </syspropertyset>
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+    </target>
+    <!--
+                end of pre NB72 profiling section
+            -->
+    <target if="netbeans.home" name="-profile-check">
+        <condition property="profiler.configured">
+            <or>
+                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
+                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
+            </or>
+        </condition>
+    </target>
+    <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
+        <startprofiler/>
+        <antcall target="run"/>
+    </target>
+    <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <startprofiler/>
+        <antcall target="run-single"/>
+    </target>
+    <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
+    <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <startprofiler/>
+        <antcall target="test-single"/>
+    </target>
+    <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <startprofiler/>
+        <antcal target="run-test-with-main"/>
+    </target>
+    <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <startprofiler/>
+        <antcall target="run-applet"/>
+    </target>
+    <!--
+                ===============
+                JAVADOC SECTION
+                ===============
+            -->
+    <target depends="init" if="have.sources" name="-javadoc-build">
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+            <and>
+                <isset property="endorsed.classpath.cmd.line.arg"/>
+                <not>
+                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <condition else="" property="bug5101868workaround" value="*.java">
+            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
+        </condition>
+        <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+            <classpath>
+                <path path="${javac.classpath}"/>
+            </classpath>
+            <fileset dir="${src.src3.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.src4.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.src2.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/*.java"/>
+                <exclude name="*.java"/>
+            </fileset>
+            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
+        </javadoc>
+        <copy todir="${dist.javadoc.dir}">
+            <fileset dir="${src.src3.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.src4.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.src2.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.src.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/doc-files/**"/>
+            </fileset>
+        </copy>
+    </target>
+    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+    </target>
+    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
+    <!--
+                =========================
+                TEST COMPILATION SECTION
+                =========================
+            -->
+    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+        <mkdir dir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-pre-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-test-depend">
+        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir=""/>
+    </target>
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir=""/>
+        <copy todir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-post-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+    <target name="-pre-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="" srcdir=""/>
+        <copy todir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-post-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+    <!--
+                =======================
+                TEST EXECUTION SECTION
+                =======================
+            -->
+    <target depends="init" if="have.tests" name="-pre-test-run">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init" if="have.tests" name="test-report"/>
+    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+    <target depends="init" if="have.tests" name="-pre-test-run-single">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
+        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
+        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
+        <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
+    <!--
+                =======================
+                TEST DEBUGGING SECTION
+                =======================
+            -->
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
+        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
+    </target>
+    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
+    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+    <!--
+                =========================
+                APPLET EXECUTION SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" name="run-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject1:java classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <!--
+                =========================
+                APPLET DEBUGGING  SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject3:debug classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
+    <!--
+                ===============
+                CLEANUP SECTION
+                ===============
+            -->
+    <target name="-deps-clean-init" unless="built-clean.properties">
+        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
+        <delete file="${built-clean.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
+        <echo level="warn" message="Cycle detected: SanityTests was already built"/>
+    </target>
+    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-clean.properties}" verbose="false"/>
+        <property file="${built-clean.properties}" prefix="already.built.clean."/>
+        <antcall target="-warn-already-built-clean"/>
+        <propertyfile file="${built-clean.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+    </target>
+    <target depends="init" name="-do-clean">
+        <delete dir="${build.dir}"/>
+        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
+    </target>
+    <target name="-post-clean">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
+    <target name="-check-call-dep">
+        <property file="${call.built.properties}" prefix="already.built."/>
+        <condition property="should.call.dep">
+            <and>
+                <not>
+                    <isset property="already.built.${call.subproject}"/>
+                </not>
+                <available file="${call.script}"/>
+            </and>
+        </condition>
+    </target>
+    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
+        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
+            <propertyset>
+                <propertyref prefix="transfer."/>
+                <mapper from="transfer.*" to="*" type="glob"/>
+            </propertyset>
+        </ant>
+    </target>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/netbeans/client_sanity/nbproject/genfiles.properties	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=0f9d9977
+build.xml.script.CRC32=f902e8b8
+build.xml.stylesheet.CRC32=8064a381@1.75.2.48
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=55414227
+nbproject/build-impl.xml.script.CRC32=c12f9d04
+nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/netbeans/client_sanity/nbproject/project.properties	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,79 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=SanityTests
+application.vendor=akouznet
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+    ${run.classpath}
+debug.test.classpath=\
+    ${run.test.classpath}
+# Files in build.classes.dir which should be excluded from distribution jar
+dist.archive.excludes=
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/SanityTests.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=*.cfg
+includes=**
+jar.compress=false
+javac.classpath=\
+    ${libs.testng.classpath}
+# Space-separated list of extra javac options
+javac.compilerargs=-Xmaxwarns 9999 -Xlint:all -Xlint:-serial
+javac.deprecation=false
+javac.external.vm=false
+javac.processorpath=\
+    ${javac.classpath}
+javac.source=1.8
+javac.target=1.8
+javac.test.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}
+javac.test.processorpath=\
+    ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project.
+# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
+# To set system properties for unit tests define test-sys-prop.name=value:
+run.jvmargs=-ea
+run.test.classpath=\
+    ${javac.test.classpath}:\
+    ${build.test.classes.dir}
+source.encoding=UTF-8
+src.src.dir=..\\..\\..\\test\\sanity\\client\\SwingSet\\src
+src.src2.dir=..\\..\\..\\test\\sanity\\client\\lib\\SwingSet3\\src
+src.src3.dir=..\\..\\..\\test\\sanity\\client\\lib\\jemmy\\src
+src.src4.dir=..\\..\\..\\test\\sanity\\client\\lib\\Jemmy2Ext\\src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/netbeans/client_sanity/nbproject/project.xml	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.java.j2seproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
+            <name>SanityTests</name>
+            <source-roots>
+                <root id="src.src3.dir" name="lib\jemmy\src"/>
+                <root id="src.src4.dir" name="lib\Jemmy2Ext\src"/>
+                <root id="src.src2.dir" name="lib\SwingSet3\src"/>
+                <root id="src.src.dir" name="SwingSet\src"/>
+            </source-roots>
+            <test-roots/>
+        </data>
+        <references xmlns="http://www.netbeans.org/ns/ant-project-references/2"/>
+    </configuration>
+</project>
--- a/make/src/classes/build/tools/module/GenModuleInfoSource.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/make/src/classes/build/tools/module/GenModuleInfoSource.java	Thu Mar 31 09:00:24 2016 -0700
@@ -25,25 +25,27 @@
 package build.tools.module;
 
 import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
- * A build tool to extend the module-info.java in the source tree
- * for platform-specific exports, uses, and provides and write
- * to the specified output file.
+ * A build tool to extend the module-info.java in the source tree for
+ * platform-specific exports, uses, and provides and write to the specified
+ * output file. Injecting platform-specific requires is not supported.
  *
- * GenModulesList build tool currently generates the modules.list from
- * the module-info.java from the source tree that will be used for
- * the make target and dependences.
- *
- * The build currently invokes gensrc-$MODULE.gmk after modules.list
- * is generated.  Hence, platform-specific requires is not supported.
+ * The extra exports, uses, provides can be specified in module-info.java.extra
+ * files and GenModuleInfoSource will be invoked for each module that has
+ * module-info.java.extra in the source directory.
  */
 public class GenModuleInfoSource {
     private final static String USAGE =
@@ -57,17 +59,32 @@
     public static void main(String... args) throws Exception {
         Path outfile = null;
         Path moduleInfoJava = null;
-        Map<String, Set<String>> options = new HashMap<>();
+        GenModuleInfoSource genModuleInfo = new GenModuleInfoSource();
 
         // validate input arguments
         for (int i = 0; i < args.length; i++){
             String option = args[i];
             if (option.startsWith("-")) {
                 String arg = args[++i];
-                if (option.equals("-exports") ||
-                        option.equals("-uses") ||
-                        option.equals("-provides")) {
-                    options.computeIfAbsent(option, _k -> new HashSet<>()).add(arg);
+                if (option.equals("-exports")) {
+                    int index = arg.indexOf('/');
+                        if (index > 0) {
+                            String pn = arg.substring(0, index);
+                            String mn = arg.substring(index + 1, arg.length());
+                            genModuleInfo.exportTo(pn, mn);
+                        } else {
+                            genModuleInfo.export(arg);
+                        }
+                } else if (option.equals("-uses")) {
+                    genModuleInfo.use(arg);
+                } else if (option.equals("-provides")) {
+                        int index = arg.indexOf('/');
+                        if (index <= 0) {
+                            throw new IllegalArgumentException("invalid -provide argument: " + arg);
+                        }
+                        String service = arg.substring(0, index);
+                        String impl = arg.substring(index + 1, arg.length());
+                        genModuleInfo.provide(service, impl);
                 } else if (option.equals("-o")) {
                     outfile = Paths.get(arg);
                 } else {
@@ -87,48 +104,145 @@
             System.err.println(USAGE);
             System.exit(-1);
         }
-        // read module-info.java
-        Module.Builder builder = ModuleInfoReader.builder(moduleInfoJava);
-        augment(builder, options);
 
         // generate new module-info.java
-        Module module = builder.build();
+        genModuleInfo.generate(moduleInfoJava, outfile);
+    }
+
+    private final Set<String> exports = new HashSet<>();
+    private final Map<String, Set<String>> exportsTo = new HashMap<>();
+    private final Set<String> uses = new HashSet<>();
+    private final Map<String, Set<String>> provides = new HashMap<>();
+    GenModuleInfoSource() {
+    }
+
+    private void export(String p) {
+        Objects.requireNonNull(p);
+        if (exports.contains(p) || exportsTo.containsKey(p)) {
+            throw new RuntimeException("duplicated exports: " + p);
+        }
+        exports.add(p);
+    }
+    private void exportTo(String p, String mn) {
+        Objects.requireNonNull(p);
+        Objects.requireNonNull(mn);
+        if (exports.contains(p)) {
+            throw new RuntimeException("unqualified exports already exists: " + p);
+        }
+        exportsTo.computeIfAbsent(p, _k -> new HashSet<>()).add(mn);
+    }
+
+    private void use(String service) {
+        uses.add(service);
+    }
+
+    private void provide(String s, String impl) {
+        provides.computeIfAbsent(s, _k -> new HashSet<>()).add(impl);
+    }
+
+    private void generate(Path sourcefile, Path outfile) throws IOException {
         Path parent = outfile.getParent();
         if (parent != null)
             Files.createDirectories(parent);
 
-        try (BufferedWriter writer = Files.newBufferedWriter(outfile)) {
-            writer.write(module.toString());
-        }
-    }
+        List<String> lines = Files.readAllLines(sourcefile);
+        try (BufferedWriter bw = Files.newBufferedWriter(outfile);
+             PrintWriter writer = new PrintWriter(bw)) {
+            int lineNumber = 0;
+            for (String l : lines) {
+                lineNumber++;
+                String[] s = l.trim().split("\\s+");
+                String keyword = s[0].trim();
+                int nextIndex = keyword.length();
+                String exp = null;
+                int n = l.length();
+                switch (keyword) {
+                    case "exports":
+                        boolean inExportsTo = false;
+                        // assume package name immediately after exports
+                        exp = s[1].trim();
+                        if (s.length >= 3) {
+                            nextIndex = l.indexOf(exp, nextIndex) + exp.length();
+                            if (s[2].trim().equals("to")) {
+                                inExportsTo = true;
+                                n = l.indexOf("to", nextIndex) + "to".length();
+                            } else {
+                                throw new RuntimeException(sourcefile + ", line " +
+                                    lineNumber + ", is malformed: " + s[2]);
+                            }
+                        }
 
-    private static void augment(Module.Builder builder, Map<String, Set<String>> options) {
-        for (String opt : options.keySet()) {
-            if (opt.equals("-exports")) {
-                for (String arg : options.get(opt)) {
-                    int index = arg.indexOf('/');
-                    if (index > 0) {
-                        String pn = arg.substring(0, index);
-                        String mn = arg.substring(index + 1, arg.length());
-                        builder.exportTo(pn, mn);
-                    } else {
-                        builder.export(arg);
-                    }
-                }
-            } else if (opt.equals("-uses")) {
-                options.get(opt).stream()
-                        .forEach(builder::use);
-            } else if (opt.equals("-provides")) {
-                for (String arg : options.get(opt)) {
-                    int index = arg.indexOf('/');
-                    if (index <= 0) {
-                        throw new IllegalArgumentException("invalid -provide argument: " + arg);
-                    }
-                    String service = arg.substring(0, index);
-                    String impl = arg.substring(index + 1, arg.length());
-                    builder.provide(service, impl);
+                        // inject the extra targets after "to"
+                        if (inExportsTo) {
+                            writer.println(injectExportTargets(exp, l, n));
+                        } else {
+                            writer.println(l);
+                        }
+                        break;
+                    case "to":
+                        if (exp == null) {
+                            throw new RuntimeException(sourcefile + ", line " +
+                                lineNumber + ", is malformed");
+                        }
+                        n = l.indexOf("to", nextIndex) + "to".length();
+                        writer.println(injectExportTargets(exp, l, n));
+                        break;
+                    case "}":
+                        doAugments(writer);
+                        // fall through
+                    default:
+                        writer.println(l);
+                        // reset exports
+                        exp = null;
                 }
             }
         }
     }
+
+    private String injectExportTargets(String pn, String exp, int pos) {
+        Set<String> targets = exportsTo.remove(pn);
+        if (targets != null) {
+            StringBuilder sb = new StringBuilder();
+            // inject the extra targets after the given pos
+            sb.append(exp.substring(0, pos))
+              .append("\n\t")
+              .append(targets.stream()
+                             .collect(Collectors.joining(",", "", ",")))
+              .append(" /* injected */");
+            if (pos < exp.length()) {
+                // print the remaining statement followed "to"
+                sb.append("\n\t")
+                  .append(exp.substring(pos+1, exp.length()));
+            }
+            return sb.toString();
+        } else {
+            return exp;
+        }
+    }
+
+    private void doAugments(PrintWriter writer) {
+        if ((exports.size() + exportsTo.size() + uses.size() + provides.size()) == 0)
+            return;
+
+        writer.println("    // augmented from module-info.java.extra");
+        exports.stream()
+            .sorted()
+            .forEach(e -> writer.format("    exports %s;%n", e));
+        // remaining injected qualified exports
+        exportsTo.entrySet().stream()
+            .sorted(Map.Entry.comparingByKey())
+            .map(e -> String.format("    exports %s to%n%s;", e.getKey(),
+                                    e.getValue().stream().sorted()
+                                        .map(mn -> String.format("        %s", mn))
+                                        .collect(Collectors.joining(",\n"))))
+            .forEach(writer::println);
+        uses.stream().sorted()
+            .forEach(s -> writer.format("    uses %s;%n", s));
+        provides.entrySet().stream()
+            .sorted(Map.Entry.comparingByKey())
+            .flatMap(e -> e.getValue().stream().sorted()
+                           .map(impl -> String.format("    provides %s with %s;",
+                                                      e.getKey(), impl)))
+            .forEach(writer::println);
+    }
 }
--- a/make/src/classes/build/tools/module/Module.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,280 +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 build.tools.module;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-public class Module {
-    public static class Dependence implements Comparable<Dependence> {
-        final String name;
-        final boolean reexport;
-        Dependence(String name) {
-            this(name, false);
-        }
-        Dependence(String name, boolean reexport) {
-            this.name = name;
-            this.reexport = reexport;
-        }
-
-        public String name() {
-            return name;
-        }
-
-        public boolean reexport(){
-            return reexport;
-        }
-
-        @Override
-        public int hashCode() {
-            int hash = 5;
-            hash = 11 * hash + Objects.hashCode(this.name);
-            hash = 11 * hash + (this.reexport ? 1 : 0);
-            return hash;
-        }
-
-        public boolean equals(Object o) {
-            Dependence d = (Dependence)o;
-            return this.name.equals(d.name) && this.reexport == d.reexport;
-        }
-
-        @Override
-        public int compareTo(Dependence o) {
-            int rc = this.name.compareTo(o.name);
-            return rc != 0 ? rc : Boolean.compare(this.reexport, o.reexport);
-        }
-
-        @Override
-        public String toString() {
-            return String.format("requires %s%s;",
-                                 reexport ? "public " : "", name);
-        }
-    }
-    private final String moduleName;
-    private final Set<Dependence> requires;
-    private final Map<String, Set<String>> exports;
-    private final Set<String> uses;
-    private final Map<String, Set<String>> provides;
-
-    private Module(String name,
-                   Set<Dependence> requires,
-                   Map<String, Set<String>> exports,
-                   Set<String> uses,
-                   Map<String, Set<String>> provides) {
-        this.moduleName = name;
-        this.requires = Collections.unmodifiableSet(requires);
-        this.exports = Collections.unmodifiableMap(exports);
-        this.uses  = Collections.unmodifiableSet(uses);
-        this.provides = Collections.unmodifiableMap(provides);
-    }
-
-    public String name() {
-        return moduleName;
-    }
-
-    public Set<Dependence> requires() {
-        return requires;
-    }
-
-    public Map<String, Set<String>> exports() {
-        return exports;
-    }
-
-    public Set<String> uses() {
-        return uses;
-    }
-
-    public Map<String, Set<String>> provides() {
-        return provides;
-    }
-
-    @Override
-    public boolean equals(Object ob) {
-        if (!(ob instanceof Module)) {
-            return false;
-        }
-        Module that = (Module) ob;
-        return (moduleName.equals(that.moduleName)
-                && requires.equals(that.requires)
-                && exports.equals(that.exports));
-    }
-
-    @Override
-    public int hashCode() {
-        int hc = moduleName.hashCode();
-        hc = hc * 43 + requires.hashCode();
-        hc = hc * 43 + exports.hashCode();
-        return hc;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(String.format("module %s {%n", moduleName));
-        requires.stream()
-                .sorted()
-                .map(d -> String.format("    requires %s%s;%n", d.reexport ? "public " : "", d.name))
-                .forEach(sb::append);
-        exports.entrySet().stream()
-                .filter(e -> e.getValue().isEmpty())
-                .sorted(Map.Entry.comparingByKey())
-                .map(e -> String.format("    exports %s;%n", e.getKey()))
-                .forEach(sb::append);
-        exports.entrySet().stream()
-                .filter(e -> !e.getValue().isEmpty())
-                .sorted(Map.Entry.comparingByKey())
-                .map(e -> String.format("    exports %s to%n%s;%n", e.getKey(),
-                        e.getValue().stream().sorted()
-                                .map(mn -> String.format("        %s", mn))
-                                .collect(Collectors.joining(",\n"))))
-                .forEach(sb::append);
-        uses.stream().sorted()
-                .map(s -> String.format("    uses %s;%n", s))
-                .forEach(sb::append);
-        provides.entrySet().stream()
-                .sorted(Map.Entry.comparingByKey())
-                .flatMap(e -> e.getValue().stream().sorted()
-                        .map(impl -> String.format("    provides %s with %s;%n", e.getKey(), impl)))
-                .forEach(sb::append);
-        sb.append("}").append("\n");
-        return sb.toString();
-    }
-
-    /**
-     * Module Builder
-     */
-    static class Builder {
-        private String name;
-        final Set<Dependence> requires = new HashSet<>();
-        final Map<String, Set<String>> exports = new HashMap<>();
-        final Set<String> uses = new HashSet<>();
-        final Map<String, Set<String>> provides = new HashMap<>();
-
-        public Builder() {
-        }
-
-        public Builder name(String n) {
-            name = n;
-            return this;
-        }
-
-        public Builder require(String d, boolean reexport) {
-            requires.add(new Dependence(d, reexport));
-            return this;
-        }
-
-        public Builder export(String p) {
-            Objects.requireNonNull(p);
-            if (exports.containsKey(p)) {
-                throw new RuntimeException(name + " already exports " + p +
-                        " " + exports.get(p));
-            }
-            return exportTo(p, Collections.emptySet());
-        }
-
-        public Builder exportTo(String p, String mn) {
-            Objects.requireNonNull(p);
-            Objects.requireNonNull(mn);
-            Set<String> ms = exports.get(p);
-            if (ms != null && ms.isEmpty()) {
-                throw new RuntimeException(name + " already has unqualified exports " + p);
-            }
-            exports.computeIfAbsent(p, _k -> new HashSet<>()).add(mn);
-            return this;
-        }
-
-        public Builder exportTo(String p, Set<String> ms) {
-            Objects.requireNonNull(p);
-            Objects.requireNonNull(ms);
-            if (exports.containsKey(p)) {
-                throw new RuntimeException(name + " already exports " + p +
-                        " " + exports.get(p));
-            }
-            exports.put(p, new HashSet<>(ms));
-            return this;
-        }
-
-        public Builder use(String cn) {
-            uses.add(cn);
-            return this;
-        }
-
-        public Builder provide(String s, String impl) {
-            provides.computeIfAbsent(s, _k -> new HashSet<>()).add(impl);
-            return this;
-        }
-
-        public Builder merge(Module m1, Module m2) {
-            if (!m1.name().equals(m2.name())) {
-                throw new IllegalArgumentException(m1.name() + " != " + m2.name());
-            }
-            name = m1.name();
-            // ## reexports
-            requires.addAll(m1.requires());
-            requires.addAll(m2.requires());
-            Stream.concat(m1.exports().keySet().stream(), m2.exports().keySet().stream())
-                    .distinct()
-                    .forEach(pn -> {
-                        Set<String> s1 = m2.exports().get(pn);
-                        Set<String> s2 = m2.exports().get(pn);
-                        if (s1 == null || s2 == null) {
-                            exportTo(pn, s1 != null ? s1 : s2);
-                        } else if (s1.isEmpty() || s2.isEmpty()) {
-                            // unqualified exports
-                            export(pn);
-                        } else {
-                            exportTo(pn, Stream.concat(s1.stream(), s2.stream())
-                                               .collect(Collectors.toSet()));
-                        }
-                    });
-            uses.addAll(m1.uses());
-            uses.addAll(m2.uses());
-            m1.provides().keySet().stream()
-                    .forEach(s -> m1.provides().get(s).stream()
-                            .forEach(impl -> provide(s, impl)));
-            m2.provides().keySet().stream()
-                    .forEach(s -> m2.provides().get(s).stream()
-                            .forEach(impl -> provide(s, impl)));
-            return this;
-        }
-
-        public Module build() {
-            Module m = new Module(name, requires, exports, uses, provides);
-            return m;
-        }
-
-        @Override
-        public String toString() {
-            return name != null ? name : "Unknown";
-        }
-    }
-}
--- a/make/src/classes/build/tools/module/ModuleInfoReader.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,357 +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 build.tools.module;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.List;
-import java.util.function.Supplier;
-import java.util.regex.Pattern;
-import java.util.stream.Stream;
-
-import build.tools.module.Module.Builder;
-
-/**
- * Source reader of module-info.java
- */
-public class ModuleInfoReader {
-    private final Path sourcefile;
-    private final Builder builder;
-    private ModuleInfoReader(Path file) {
-        this.sourcefile = file;
-        this.builder = new Builder();
-    }
-
-    public static Builder builder(Path file) throws IOException {
-        ModuleInfoReader reader = new ModuleInfoReader(file);
-        reader.readFile();
-        return reader.builder;
-    }
-
-    /**
-     * Reads the source file.
-     */
-    void readFile() throws IOException {
-        List<String> lines = Files.readAllLines(sourcefile);
-        boolean done = false;
-        int lineNumber = 0;
-        boolean inBlockComment = false;
-        boolean inRequires = false;
-        boolean reexports = false;
-        boolean inProvides = false;
-        boolean inWith = false;
-        String serviceIntf = null;
-        String providerClass = null;
-        boolean inUses = false;
-        boolean inExports = false;
-        boolean inExportsTo = false;
-        String qualifiedExports = null;
-        Counter counter = new Counter();
-
-        for (String line : lines) {
-            lineNumber++;
-            if (inBlockComment) {
-                int c = line.indexOf("*/");
-                if (c >= 0) {
-                    line = line.substring(c + 2, line.length());
-                    inBlockComment = false;
-                } else {
-                    // skip lines until end of comment block
-                    continue;
-                }
-            }
-            inBlockComment = beginBlockComment(line);
-
-            line = trimComment(line).trim();
-            // ignore empty lines
-            if (line.length() == 0) {
-                continue;
-            }
-            String values;
-            if (inRequires || inExports | inUses | (inWith && providerClass == null)) {
-                values = line;
-            } else {
-                String[] s = line.split("\\s+");
-                String keyword = s[0].trim();
-                int nextIndex = keyword.length();
-                switch (keyword) {
-                    case "module":
-                        if (s.length != 3 || !s[2].trim().equals("{")) {
-                            throw new RuntimeException(sourcefile + ", line " +
-                                    lineNumber + ", is malformed");
-                        }
-                        builder.name(s[1].trim());
-                        continue;  // next line
-                    case "requires":
-                        inRequires = true;
-                        counter.numRequires++;
-                        if (s.length >= 2) {
-                            String ss = s[1].trim();
-                            if (ss.equals("public")) {
-                                nextIndex = line.indexOf(ss) + ss.length();
-                                reexports = true;
-                            }
-                        }
-                        break;
-                    case "exports":
-                        inExports = true;
-                        inExportsTo = false;
-                        counter.numExports++;
-                        qualifiedExports = null;
-                        if (s.length >= 3) {
-                            qualifiedExports = s[1].trim();
-                            nextIndex = line.indexOf(qualifiedExports, nextIndex)
-                                            + qualifiedExports.length();
-                            if (s[2].trim().equals("to")) {
-                                inExportsTo = true;
-                                nextIndex = line.indexOf("to", nextIndex) + "to".length();
-                            } else {
-                                throw new RuntimeException(sourcefile + ", line " +
-                                        lineNumber + ", is malformed: " + s[2]);
-                            }
-                        }
-                        break;
-                    case "to":
-                        if (!inExports || qualifiedExports == null) {
-                            throw new RuntimeException(sourcefile + ", line " +
-                                    lineNumber + ", is malformed");
-                        }
-                        inExportsTo = true;
-                        break;
-                    case "uses":
-                        inUses = true;
-                        counter.numUses++;
-                        break;
-                    case "provides":
-                        inProvides = true;
-                        inWith = false;
-                        counter.numProvides++;
-                        serviceIntf = null;
-                        providerClass = null;
-                        if (s.length >= 2) {
-                            serviceIntf = s[1].trim();
-                            nextIndex = line.indexOf(serviceIntf) + serviceIntf.length();
-                        }
-                        if (s.length >= 3) {
-                            if (s[2].trim().equals("with")) {
-                                inWith = true;
-                                nextIndex = line.indexOf("with") + "with".length();
-                            } else {
-                                throw new RuntimeException(sourcefile + ", line " +
-                                        lineNumber + ", is malformed: " + s[2]);
-                            }
-                        }
-                        break;
-                    case "with":
-                        if (!inProvides || serviceIntf == null) {
-                            throw new RuntimeException(sourcefile + ", line " +
-                                    lineNumber + ", is malformed");
-                        }
-                        inWith = true;
-                        nextIndex = line.indexOf("with") + "with".length();
-                        break;
-                    case "}":
-                        counter.validate(builder);
-                        done = true;
-                        continue;  // next line
-                    default:
-                        throw new RuntimeException(sourcefile + ", \"" +
-                                keyword + "\" on line " +
-                                lineNumber + ", is not recognized");
-                }
-                values = line.substring(nextIndex, line.length()).trim();
-            }
-
-            int len = values.length();
-            if (len == 0) {
-                continue;  // next line
-            }
-            char lastchar = values.charAt(len - 1);
-            if (lastchar != ',' && lastchar != ';') {
-                throw new RuntimeException(sourcefile + ", line " +
-                        lineNumber + ", is malformed:" +
-                        " ',' or ';' is missing.");
-            }
-
-            values = values.substring(0, len - 1).trim();
-            // parse the values specified for a keyword specified
-            for (String s : values.split(",")) {
-                s = s.trim();
-                if (s.length() > 0) {
-                    if (inRequires) {
-                        if (builder.requires.contains(s)) {
-                            throw new RuntimeException(sourcefile + ", line "
-                                    + lineNumber + " duplicated requires: \"" + s + "\"");
-                        }
-                        builder.require(s, reexports);
-                    } else if (inExports) {
-                        if (!inExportsTo && qualifiedExports == null) {
-                            builder.export(s);
-                        } else {
-                            builder.exportTo(qualifiedExports, s);
-                        }
-                    } else if (inUses) {
-                        builder.use(s);
-                    } else if (inProvides) {
-                        if (!inWith) {
-                            serviceIntf = s;
-                        } else {
-                            providerClass = s;
-                            builder.provide(serviceIntf, providerClass);
-                        }
-                    }
-                }
-            }
-            if (lastchar == ';') {
-                inRequires = false;
-                reexports = false;
-                inExports = false;
-                inExportsTo = false;
-                inProvides = false;
-                inWith = false;
-                inUses = false;
-            }
-        }
-
-        if (inBlockComment) {
-            throw new RuntimeException(sourcefile + ", line " +
-                    lineNumber + ", missing \"*/\" to end a block comment");
-        }
-        if (!done) {
-            throw new RuntimeException(sourcefile + ", line " +
-                    lineNumber + ", missing \"}\" to end module definition" +
-                    " for \"" + builder + "\"");
-        }
-        return;
-    }
-
-    // the naming convention for the module names without dashes
-    private static final Pattern CLASS_NAME_PATTERN = Pattern.compile("[\\w\\.\\*_$/]+");
-    private static boolean beginBlockComment(String line) {
-        int pos = 0;
-        while (pos >= 0 && pos < line.length()) {
-            int c = line.indexOf("/*", pos);
-            if (c < 0) {
-                return false;
-            }
-
-            if (c > 0 && !Character.isWhitespace(line.charAt(c - 1))) {
-                return false;
-            }
-
-            int c1 = line.indexOf("//", pos);
-            if (c1 >= 0 && c1 < c) {
-                return false;
-            }
-
-            int c2 = line.indexOf("*/", c + 2);
-            if (c2 < 0) {
-                return true;
-            }
-            pos = c + 2;
-        }
-        return false;
-    }
-    private static String trimComment(String line) {
-        StringBuilder sb = new StringBuilder();
-
-        int pos = 0;
-        while (pos >= 0 && pos < line.length()) {
-            int c1 = line.indexOf("//", pos);
-            if (c1 > 0 && !Character.isWhitespace(line.charAt(c1 - 1))) {
-                // not a comment
-                c1 = -1;
-            }
-
-            int c2 = line.indexOf("/*", pos);
-            if (c2 > 0 && !Character.isWhitespace(line.charAt(c2 - 1))) {
-                // not a comment
-                c2 = -1;
-            }
-
-            int c = line.length();
-            int n = line.length();
-            if (c1 >= 0 || c2 >= 0) {
-                if (c1 >= 0) {
-                    c = c1;
-                }
-                if (c2 >= 0 && c2 < c) {
-                    c = c2;
-                }
-                int c3 = line.indexOf("*/", c2 + 2);
-                if (c == c2 && c3 > c2) {
-                    n = c3 + 2;
-                }
-            }
-            if (c > 0) {
-                if (sb.length() > 0) {
-                    // add a whitespace if multiple comments on one line
-                    sb.append(" ");
-                }
-                sb.append(line.substring(pos, c));
-            }
-            pos = n;
-        }
-        return sb.toString();
-    }
-
-
-    static class Counter {
-        int numRequires;
-        int numExports;
-        int numUses;
-        int numProvides;
-
-        void validate(Builder builder) {
-            assertEquals("requires", numRequires, builder.requires.size(),
-                         () -> builder.requires.stream()
-                                      .map(Module.Dependence::toString));
-            assertEquals("exports", numExports, builder.exports.size(),
-                         () -> builder.exports.entrySet().stream()
-                                      .map(e -> "exports " + e.getKey() + " to " + e.getValue()));
-            assertEquals("uses", numUses, builder.uses.size(),
-                         () -> builder.uses.stream());
-            assertEquals("provides", numProvides,
-                         (int)builder.provides.values().stream()
-                                     .flatMap(s -> s.stream())
-                                     .count(),
-                         () -> builder.provides.entrySet().stream()
-                                      .map(e -> "provides " + e.getKey() + " with " + e.getValue()));
-        }
-
-        private static void assertEquals(String msg, int expected, int got,
-                                         Supplier<Stream<String>> supplier) {
-            if (expected != got){
-                System.err.println("ERROR: mismatched " + msg +
-                        " expected: " + expected + " got: " + got );
-                supplier.get().sorted()
-                        .forEach(System.err::println);
-                throw new AssertionError("mismatched " + msg +
-                        " expected: " + expected + " got: " + got + " ");
-            }
-        }
-    }
-}
--- a/make/src/classes/build/tools/module/ModulesXmlReader.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +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 build.tools.module;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.XMLEvent;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.HashSet;
-import java.util.Set;
-
-public class ModulesXmlReader {
-
-    private ModulesXmlReader() {}
-
-    public static Set<Module> readModules(Path modulesXml)
-        throws XMLStreamException, IOException
-    {
-        Set<Module> modules = new HashSet<>();
-        try (InputStream in = new BufferedInputStream(Files.newInputStream(modulesXml))) {
-            Set<Module> mods = ModulesXmlReader.load(in);
-            modules.addAll(mods);
-        }
-        return modules;
-    }
-
-    private static final String MODULES   = "modules";
-    private static final String MODULE    = "module";
-    private static final String NAME      = "name";
-    private static final String DEPEND    = "depend";
-    private static final String EXPORT    = "export";
-    private static final String TO        = "to";
-    private static final QName  REEXPORTS = new QName("re-exports");
-    private static Set<Module> load(InputStream in)
-        throws XMLStreamException, IOException
-    {
-        Set<Module> modules = new HashSet<>();
-        XMLInputFactory factory = XMLInputFactory.newInstance();
-        XMLEventReader stream = factory.createXMLEventReader(in);
-        Module.Builder mb = null;
-        String modulename = null;
-        String pkg = null;
-        Set<String> permits = new HashSet<>();
-        while (stream.hasNext()) {
-            XMLEvent event = stream.nextEvent();
-            if (event.isStartElement()) {
-                String startTag = event.asStartElement().getName().getLocalPart();
-                switch (startTag) {
-                    case MODULES:
-                        break;
-                    case MODULE:
-                        if (mb != null) {
-                            throw new RuntimeException("end tag for module is missing");
-                        }
-                        modulename = getNextTag(stream, NAME);
-                        mb = new Module.Builder();
-                        mb.name(modulename);
-                        break;
-                    case NAME:
-                        throw new RuntimeException(event.toString());
-                    case DEPEND:
-                        boolean reexports = false;
-                        Attribute attr = event.asStartElement().getAttributeByName(REEXPORTS);
-                        if (attr != null) {
-                            String value = attr.getValue();
-                            if (value.equals("true") || value.equals("false")) {
-                                reexports = Boolean.parseBoolean(value);
-                            } else {
-                                throw new RuntimeException("unexpected attribute " + attr.toString());
-                            }
-                        }
-                        mb.require(getData(stream), reexports);
-                        break;
-                    case EXPORT:
-                        pkg = getNextTag(stream, NAME);
-                        break;
-                    case TO:
-                        permits.add(getData(stream));
-                        break;
-                    default:
-                }
-            } else if (event.isEndElement()) {
-                String endTag = event.asEndElement().getName().getLocalPart();
-                switch (endTag) {
-                    case MODULE:
-                        modules.add(mb.build());
-                        mb = null;
-                        break;
-                    case EXPORT:
-                        if (pkg == null) {
-                            throw new RuntimeException("export-to is malformed");
-                        }
-                        mb.exportTo(pkg, permits);
-                        pkg = null;
-                        permits.clear();
-                        break;
-                    default:
-                }
-            } else if (event.isCharacters()) {
-                String s = event.asCharacters().getData();
-                if (!s.trim().isEmpty()) {
-                    throw new RuntimeException("export-to is malformed");
-                }
-            }
-        }
-        return modules;
-    }
-
-    private static String getData(XMLEventReader reader)
-        throws XMLStreamException
-    {
-        XMLEvent e = reader.nextEvent();
-        if (e.isCharacters())
-            return e.asCharacters().getData();
-
-        throw new RuntimeException(e.toString());
-    }
-
-    private static String getNextTag(XMLEventReader reader, String tag)
-        throws XMLStreamException
-    {
-        XMLEvent e = reader.nextTag();
-        if (e.isStartElement()) {
-            String t = e.asStartElement().getName().getLocalPart();
-            if (!tag.equals(t)) {
-                throw new RuntimeException(e + " expected: " + tag);
-            }
-            return getData(reader);
-        }
-        throw new RuntimeException("export-to name is missing:" + e);
-    }
-}
--- a/make/src/classes/build/tools/module/ModulesXmlWriter.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +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 build.tools.module;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Map;
-import java.util.Set;
-
-public final class ModulesXmlWriter {
-
-    private ModulesXmlWriter() {}
-
-    public static void writeModules(Set<Module> modules, Path path)
-        throws IOException, XMLStreamException
-    {
-        writeXML(modules, path);
-    }
-
-    private static final String MODULES   = "modules";
-    private static final String MODULE    = "module";
-    private static final String NAME      = "name";
-    private static final String DEPEND    = "depend";
-    private static final String EXPORT    = "export";
-    private static final String TO        = "to";
-    private static final QName  REEXPORTS = new QName("re-exports");
-
-    private static void writeXML(Set<Module> modules, Path path)
-        throws IOException, XMLStreamException
-    {
-        XMLOutputFactory xof = XMLOutputFactory.newInstance();
-        try (OutputStream out = Files.newOutputStream(path)) {
-            int depth = 0;
-            XMLStreamWriter xtw = xof.createXMLStreamWriter(out, "UTF-8");
-            xtw.writeStartDocument("utf-8","1.0");
-            writeStartElement(xtw, MODULES, depth);
-            modules.stream()
-                   .sorted(Comparator.comparing(Module::name))
-                   .forEach(m -> writeModuleElement(xtw, m, depth+1));
-            writeEndElement(xtw, depth);
-            xtw.writeCharacters("\n");
-            xtw.writeEndDocument();
-            xtw.flush();
-            xtw.close();
-        }
-    }
-
-    private static void writeElement(XMLStreamWriter xtw,
-                                     String element,
-                                     String value,
-                                     int depth) {
-        try {
-            writeStartElement(xtw, element, depth);
-            xtw.writeCharacters(value);
-            xtw.writeEndElement();
-        } catch (XMLStreamException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    private static void writeDependElement(XMLStreamWriter xtw,
-                                           Module.Dependence d,
-                                           int depth) {
-        try {
-            writeStartElement(xtw, DEPEND, depth);
-            if (d.reexport) {
-                xtw.writeAttribute("re-exports", "true");
-            }
-            xtw.writeCharacters(d.name);
-            xtw.writeEndElement();
-        } catch (XMLStreamException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    private static void writeExportElement(XMLStreamWriter xtw,
-                                           String pkg,
-                                           int depth) {
-        writeExportElement(xtw, pkg, Collections.emptySet(), depth);
-    }
-
-    private static void writeExportElement(XMLStreamWriter xtw,
-                                           String pkg,
-                                           Set<String> permits,
-                                           int depth) {
-        try {
-            writeStartElement(xtw, EXPORT, depth);
-            writeElement(xtw, NAME, pkg, depth+1);
-            if (!permits.isEmpty()) {
-                permits.stream().sorted()
-                       .forEach(m -> writeElement(xtw, TO, m, depth + 1));
-            }
-            writeEndElement(xtw, depth);
-        } catch (XMLStreamException e) {
-            throw new RuntimeException(e);
-        }
-    }
-    private static void writeModuleElement(XMLStreamWriter xtw,
-                                           Module m,
-                                           int depth) {
-        try {
-            writeStartElement(xtw, MODULE, depth);
-            writeElement(xtw, NAME, m.name(), depth+1);
-            m.requires().stream().sorted(Comparator.comparing(d -> d.name))
-                        .forEach(d -> writeDependElement(xtw, d, depth+1));
-            m.exports().keySet().stream()
-                       .filter(pn -> m.exports().get(pn).isEmpty())
-                       .sorted()
-                       .forEach(pn -> writeExportElement(xtw, pn, depth+1));
-            m.exports().entrySet().stream()
-                       .filter(e -> !e.getValue().isEmpty())
-                       .sorted(Map.Entry.comparingByKey())
-                       .forEach(e -> writeExportElement(xtw, e.getKey(), e.getValue(), depth+1));
-            writeEndElement(xtw, depth);
-        } catch (XMLStreamException e) {
-            throw new RuntimeException(e);
-
-        }
-    }
-
-    /** Two spaces; the default indentation. */
-    public static final String DEFAULT_INDENT = "  ";
-
-    /** stack[depth] indicates what's been written into the current scope. */
-    private static String[] stack = new String[] { "\n",
-        "\n" + DEFAULT_INDENT,
-        "\n" + DEFAULT_INDENT + DEFAULT_INDENT,
-        "\n" + DEFAULT_INDENT + DEFAULT_INDENT + DEFAULT_INDENT};
-
-    private static void writeStartElement(XMLStreamWriter xtw,
-                                          String name,
-                                          int depth)
-        throws XMLStreamException
-    {
-        xtw.writeCharacters(stack[depth]);
-        xtw.writeStartElement(name);
-    }
-
-    private static void writeEndElement(XMLStreamWriter xtw, int depth)
-        throws XMLStreamException
-    {
-        xtw.writeCharacters(stack[depth]);
-        xtw.writeEndElement();
-    }
-}
--- a/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java	Thu Mar 31 09:00:24 2016 -0700
@@ -255,7 +255,6 @@
      */
     private static final class Recipe {
         private final List<RecipeElement> elements;
-        private final List<RecipeElement> elementsRev;
 
         public Recipe(String src, Object[] constants) {
             List<RecipeElement> el = new ArrayList<>();
@@ -294,19 +293,13 @@
                 el.add(new RecipeElement(acc.toString()));
             }
 
-            elements = new ArrayList<>(el);
-            Collections.reverse(el);
-            elementsRev = el;
+            elements = el;
         }
 
-        public Collection<RecipeElement> getElements() {
+        public List<RecipeElement> getElements() {
             return elements;
         }
 
-        public Collection<RecipeElement> getElementsReversed() {
-            return elementsRev;
-        }
-
         @Override
         public boolean equals(Object o) {
             if (this == o) return true;
@@ -1310,7 +1303,9 @@
 
             // Compose append calls. This is done in reverse because the application order is
             // reverse as well.
-            for (RecipeElement el : recipe.getElementsReversed()) {
+            List<RecipeElement> elements = recipe.getElements();
+            for (int i = elements.size() - 1; i >= 0; i--) {
+                RecipeElement el = elements.get(i);
                 MethodHandle appender;
                 switch (el.getTag()) {
                     case CONST: {
--- a/src/java.base/share/classes/java/util/AbstractList.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/java.base/share/classes/java/util/AbstractList.java	Thu Mar 31 09:00:24 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -462,10 +462,9 @@
      * @implSpec
      * This implementation returns a list that subclasses
      * {@code AbstractList}.  The subclass stores, in private fields, the
-     * offset of the subList within the backing list, the size of the subList
-     * (which can change over its lifetime), and the expected
-     * {@code modCount} value of the backing list.  There are two variants
-     * of the subclass, one of which implements {@code RandomAccess}.
+     * size of the subList (which can change over its lifetime), and the
+     * expected {@code modCount} value of the backing list.  There are two
+     * variants of the subclass, one of which implements {@code RandomAccess}.
      * If this list implements {@code RandomAccess} the returned list will
      * be an instance of the subclass that implements {@code RandomAccess}.
      *
@@ -493,11 +492,22 @@
      *         {@code (fromIndex > toIndex)}
      */
     public List<E> subList(int fromIndex, int toIndex) {
+        subListRangeCheck(fromIndex, toIndex, size());
         return (this instanceof RandomAccess ?
                 new RandomAccessSubList<>(this, fromIndex, toIndex) :
                 new SubList<>(this, fromIndex, toIndex));
     }
 
+    static void subListRangeCheck(int fromIndex, int toIndex, int size) {
+        if (fromIndex < 0)
+            throw new IndexOutOfBoundsException("fromIndex = " + fromIndex);
+        if (toIndex > size)
+            throw new IndexOutOfBoundsException("toIndex = " + toIndex);
+        if (fromIndex > toIndex)
+            throw new IllegalArgumentException("fromIndex(" + fromIndex +
+                                               ") > toIndex(" + toIndex + ")");
+    }
+
     // Comparison and hashing
 
     /**
@@ -623,174 +633,199 @@
     private String outOfBoundsMsg(int index) {
         return "Index: "+index+", Size: "+size();
     }
-}
 
-class SubList<E> extends AbstractList<E> {
-    private final AbstractList<E> l;
-    private final int offset;
-    private int size;
+    private static class SubList<E> extends AbstractList<E> {
+        private final AbstractList<E> root;
+        private final SubList<E> parent;
+        private final int offset;
+        protected int size;
 
-    SubList(AbstractList<E> list, int fromIndex, int toIndex) {
-        if (fromIndex < 0)
-            throw new IndexOutOfBoundsException("fromIndex = " + fromIndex);
-        if (toIndex > list.size())
-            throw new IndexOutOfBoundsException("toIndex = " + toIndex);
-        if (fromIndex > toIndex)
-            throw new IllegalArgumentException("fromIndex(" + fromIndex +
-                                               ") > toIndex(" + toIndex + ")");
-        l = list;
-        offset = fromIndex;
-        size = toIndex - fromIndex;
-        this.modCount = l.modCount;
+        /**
+         * Constructs a sublist of an arbitrary AbstractList, which is
+         * not a SubList itself.
+         */
+        public SubList(AbstractList<E> root, int fromIndex, int toIndex) {
+            this.root = root;
+            this.parent = null;
+            this.offset = fromIndex;
+            this.size = toIndex - fromIndex;
+            this.modCount = root.modCount;
+        }
+
+        /**
+         * Constructs a sublist of another SubList.
+         */
+        protected SubList(SubList<E> parent, int fromIndex, int toIndex) {
+            this.root = parent.root;
+            this.parent = parent;
+            this.offset = parent.offset + fromIndex;
+            this.size = toIndex - fromIndex;
+            this.modCount = root.modCount;
+        }
+
+        public E set(int index, E element) {
+            Objects.checkIndex(index, size);
+            checkForComodification();
+            return root.set(offset + index, element);
+        }
+
+        public E get(int index) {
+            Objects.checkIndex(index, size);
+            checkForComodification();
+            return root.get(offset + index);
+        }
+
+        public int size() {
+            checkForComodification();
+            return size;
+        }
+
+        public void add(int index, E element) {
+            rangeCheckForAdd(index);
+            checkForComodification();
+            root.add(offset + index, element);
+            updateSizeAndModCount(1);
+        }
+
+        public E remove(int index) {
+            Objects.checkIndex(index, size);
+            checkForComodification();
+            E result = root.remove(offset + index);
+            updateSizeAndModCount(-1);
+            return result;
+        }
+
+        protected void removeRange(int fromIndex, int toIndex) {
+            checkForComodification();
+            root.removeRange(offset + fromIndex, offset + toIndex);
+            updateSizeAndModCount(fromIndex - toIndex);
+        }
+
+        public boolean addAll(Collection<? extends E> c) {
+            return addAll(size, c);
+        }
+
+        public boolean addAll(int index, Collection<? extends E> c) {
+            rangeCheckForAdd(index);
+            int cSize = c.size();
+            if (cSize==0)
+                return false;
+            checkForComodification();
+            root.addAll(offset + index, c);
+            updateSizeAndModCount(cSize);
+            return true;
+        }
+
+        public Iterator<E> iterator() {
+            return listIterator();
+        }
+
+        public ListIterator<E> listIterator(int index) {
+            checkForComodification();
+            rangeCheckForAdd(index);
+
+            return new ListIterator<E>() {
+                private final ListIterator<E> i =
+                        root.listIterator(offset + index);
+
+                public boolean hasNext() {
+                    return nextIndex() < size;
+                }
+
+                public E next() {
+                    if (hasNext())
+                        return i.next();
+                    else
+                        throw new NoSuchElementException();
+                }
+
+                public boolean hasPrevious() {
+                    return previousIndex() >= 0;
+                }
+
+                public E previous() {
+                    if (hasPrevious())
+                        return i.previous();
+                    else
+                        throw new NoSuchElementException();
+                }
+
+                public int nextIndex() {
+                    return i.nextIndex() - offset;
+                }
+
+                public int previousIndex() {
+                    return i.previousIndex() - offset;
+                }
+
+                public void remove() {
+                    i.remove();
+                    updateSizeAndModCount(-1);
+                }
+
+                public void set(E e) {
+                    i.set(e);
+                }
+
+                public void add(E e) {
+                    i.add(e);
+                    updateSizeAndModCount(1);
+                }
+            };
+        }
+
+        public List<E> subList(int fromIndex, int toIndex) {
+            subListRangeCheck(fromIndex, toIndex, size);
+            return new SubList<>(this, fromIndex, toIndex);
+        }
+
+        private void rangeCheckForAdd(int index) {
+            if (index < 0 || index > size)
+                throw new IndexOutOfBoundsException(outOfBoundsMsg(index));
+        }
+
+        private String outOfBoundsMsg(int index) {
+            return "Index: "+index+", Size: "+size;
+        }
+
+        private void checkForComodification() {
+            if (root.modCount != this.modCount)
+                throw new ConcurrentModificationException();
+        }
+
+        private void updateSizeAndModCount(int sizeChange) {
+            SubList<E> slist = this;
+            do {
+                slist.size += sizeChange;
+                slist.modCount = root.modCount;
+                slist = slist.parent;
+            } while (slist != null);
+        }
     }
 
-    public E set(int index, E element) {
-        rangeCheck(index);
-        checkForComodification();
-        return l.set(index+offset, element);
-    }
+    private static class RandomAccessSubList<E>
+            extends SubList<E> implements RandomAccess {
 
-    public E get(int index) {
-        rangeCheck(index);
-        checkForComodification();
-        return l.get(index+offset);
-    }
+        /**
+         * Constructs a sublist of an arbitrary AbstractList, which is
+         * not a RandomAccessSubList itself.
+         */
+        RandomAccessSubList(AbstractList<E> root,
+                int fromIndex, int toIndex) {
+            super(root, fromIndex, toIndex);
+        }
 
-    public int size() {
-        checkForComodification();
-        return size;
-    }
+        /**
+         * Constructs a sublist of another RandomAccessSubList.
+         */
+        RandomAccessSubList(RandomAccessSubList<E> parent,
+                int fromIndex, int toIndex) {
+            super(parent, fromIndex, toIndex);
+        }
 
-    public void add(int index, E element) {
-        rangeCheckForAdd(index);
-        checkForComodification();
-        l.add(index+offset, element);
-        this.modCount = l.modCount;
-        size++;
-    }
-
-    public E remove(int index) {
-        rangeCheck(index);
-        checkForComodification();
-        E result = l.remove(index+offset);
-        this.modCount = l.modCount;
-        size--;
-        return result;
-    }
-
-    protected void removeRange(int fromIndex, int toIndex) {
-        checkForComodification();
-        l.removeRange(fromIndex+offset, toIndex+offset);
-        this.modCount = l.modCount;
-        size -= (toIndex-fromIndex);
-    }
-
-    public boolean addAll(Collection<? extends E> c) {
-        return addAll(size, c);
-    }
-
-    public boolean addAll(int index, Collection<? extends E> c) {
-        rangeCheckForAdd(index);
-        int cSize = c.size();
-        if (cSize==0)
-            return false;
-
-        checkForComodification();
-        l.addAll(offset+index, c);
-        this.modCount = l.modCount;
-        size += cSize;
-        return true;
-    }
-
-    public Iterator<E> iterator() {
-        return listIterator();
-    }
-
-    public ListIterator<E> listIterator(final int index) {
-        checkForComodification();
-        rangeCheckForAdd(index);
-
-        return new ListIterator<E>() {
-            private final ListIterator<E> i = l.listIterator(index+offset);
-
-            public boolean hasNext() {
-                return nextIndex() < size;
-            }
-
-            public E next() {
-                if (hasNext())
-                    return i.next();
-                else
-                    throw new NoSuchElementException();
-            }
-
-            public boolean hasPrevious() {
-                return previousIndex() >= 0;
-            }
-
-            public E previous() {
-                if (hasPrevious())
-                    return i.previous();
-                else
-                    throw new NoSuchElementException();
-            }
-
-            public int nextIndex() {
-                return i.nextIndex() - offset;
-            }
-
-            public int previousIndex() {
-                return i.previousIndex() - offset;
-            }
-
-            public void remove() {
-                i.remove();
-                SubList.this.modCount = l.modCount;
-                size--;
-            }
-
-            public void set(E e) {
-                i.set(e);
-            }
-
-            public void add(E e) {
-                i.add(e);
-                SubList.this.modCount = l.modCount;
-                size++;
-            }
-        };
-    }
-
-    public List<E> subList(int fromIndex, int toIndex) {
-        return new SubList<>(this, fromIndex, toIndex);
-    }
-
-    private void rangeCheck(int index) {
-        if (index < 0 || index >= size)
-            throw new IndexOutOfBoundsException(outOfBoundsMsg(index));
-    }
-
-    private void rangeCheckForAdd(int index) {
-        if (index < 0 || index > size)
-            throw new IndexOutOfBoundsException(outOfBoundsMsg(index));
-    }
-
-    private String outOfBoundsMsg(int index) {
-        return "Index: "+index+", Size: "+size;
-    }
-
-    private void checkForComodification() {
-        if (this.modCount != l.modCount)
-            throw new ConcurrentModificationException();
+        public List<E> subList(int fromIndex, int toIndex) {
+            subListRangeCheck(fromIndex, toIndex, size);
+            return new RandomAccessSubList<>(this, fromIndex, toIndex);
+        }
     }
 }
-
-class RandomAccessSubList<E> extends SubList<E> implements RandomAccess {
-    RandomAccessSubList(AbstractList<E> list, int fromIndex, int toIndex) {
-        super(list, fromIndex, toIndex);
-    }
-
-    public List<E> subList(int fromIndex, int toIndex) {
-        return new RandomAccessSubList<>(this, fromIndex, toIndex);
-    }
-}
--- a/src/java.base/share/classes/java/util/ArrayList.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/java.base/share/classes/java/util/ArrayList.java	Thu Mar 31 09:00:24 2016 -0700
@@ -432,8 +432,7 @@
      * @throws IndexOutOfBoundsException {@inheritDoc}
      */
     public E get(int index) {
-        rangeCheck(index);
-
+        Objects.checkIndex(index, size);
         return elementData(index);
     }
 
@@ -447,8 +446,7 @@
      * @throws IndexOutOfBoundsException {@inheritDoc}
      */
     public E set(int index, E element) {
-        rangeCheck(index);
-
+        Objects.checkIndex(index, size);
         E oldValue = elementData(index);
         elementData[index] = element;
         return oldValue;
@@ -511,7 +509,7 @@
      * @throws IndexOutOfBoundsException {@inheritDoc}
      */
     public E remove(int index) {
-        rangeCheck(index);
+        Objects.checkIndex(index, size);
 
         modCount++;
         E oldValue = elementData(index);
@@ -680,17 +678,6 @@
     }
 
     /**
-     * Checks if the given index is in range.  If not, throws an appropriate
-     * runtime exception.  This method does *not* check if the index is
-     * negative: It is always used immediately prior to an array access,
-     * which throws an ArrayIndexOutOfBoundsException if index is negative.
-     */
-    private void rangeCheck(int index) {
-        if (index >= size)
-            throw new IndexOutOfBoundsException(outOfBoundsMsg(index));
-    }
-
-    /**
      * A version of rangeCheck used by add and addAll.
      */
     private void rangeCheckForAdd(int index) {
@@ -854,8 +841,7 @@
      * @throws IndexOutOfBoundsException {@inheritDoc}
      */
     public ListIterator<E> listIterator(int index) {
-        if (index < 0 || index > size)
-            throw new IndexOutOfBoundsException("Index: "+index);
+        rangeCheckForAdd(index);
         return new ListItr(index);
     }
 
@@ -1042,76 +1028,75 @@
      */
     public List<E> subList(int fromIndex, int toIndex) {
         subListRangeCheck(fromIndex, toIndex, size);
-        return new SubList(this, 0, fromIndex, toIndex);
+        return new SubList<>(this, fromIndex, toIndex);
     }
 
-    static void subListRangeCheck(int fromIndex, int toIndex, int size) {
-        if (fromIndex < 0)
-            throw new IndexOutOfBoundsException("fromIndex = " + fromIndex);
-        if (toIndex > size)
-            throw new IndexOutOfBoundsException("toIndex = " + toIndex);
-        if (fromIndex > toIndex)
-            throw new IllegalArgumentException("fromIndex(" + fromIndex +
-                                               ") > toIndex(" + toIndex + ")");
-    }
+    private static class SubList<E> extends AbstractList<E> implements RandomAccess {
+        private final ArrayList<E> root;
+        private final SubList<E> parent;
+        private final int offset;
+        private int size;
 
-    private class SubList extends AbstractList<E> implements RandomAccess {
-        private final AbstractList<E> parent;
-        private final int parentOffset;
-        private final int offset;
-        int size;
-
-        SubList(AbstractList<E> parent,
-                int offset, int fromIndex, int toIndex) {
-            this.parent = parent;
-            this.parentOffset = fromIndex;
-            this.offset = offset + fromIndex;
+        /**
+         * Constructs a sublist of an arbitrary ArrayList.
+         */
+        public SubList(ArrayList<E> root, int fromIndex, int toIndex) {
+            this.root = root;
+            this.parent = null;
+            this.offset = fromIndex;
             this.size = toIndex - fromIndex;
-            this.modCount = ArrayList.this.modCount;
+            this.modCount = root.modCount;
         }
 
-        public E set(int index, E e) {
-            rangeCheck(index);
+        /**
+         * Constructs a sublist of another SubList.
+         */
+        private SubList(SubList<E> parent, int fromIndex, int toIndex) {
+            this.root = parent.root;
+            this.parent = parent;
+            this.offset = parent.offset + fromIndex;
+            this.size = toIndex - fromIndex;
+            this.modCount = root.modCount;
+        }
+
+        public E set(int index, E element) {
+            Objects.checkIndex(index, size);
             checkForComodification();
-            E oldValue = ArrayList.this.elementData(offset + index);
-            ArrayList.this.elementData[offset + index] = e;
+            E oldValue = root.elementData(offset + index);
+            root.elementData[offset + index] = element;
             return oldValue;
         }
 
         public E get(int index) {
-            rangeCheck(index);
+            Objects.checkIndex(index, size);
             checkForComodification();
-            return ArrayList.this.elementData(offset + index);
+            return root.elementData(offset + index);
         }
 
         public int size() {
             checkForComodification();
-            return this.size;
+            return size;
         }
 
-        public void add(int index, E e) {
+        public void add(int index, E element) {
             rangeCheckForAdd(index);
             checkForComodification();
-            parent.add(parentOffset + index, e);
-            this.modCount = parent.modCount;
-            this.size++;
+            root.add(offset + index, element);
+            updateSizeAndModCount(1);
         }
 
         public E remove(int index) {
-            rangeCheck(index);
+            Objects.checkIndex(index, size);
             checkForComodification();
-            E result = parent.remove(parentOffset + index);
-            this.modCount = parent.modCount;
-            this.size--;
+            E result = root.remove(offset + index);
+            updateSizeAndModCount(-1);
             return result;
         }
 
         protected void removeRange(int fromIndex, int toIndex) {
             checkForComodification();
-            parent.removeRange(parentOffset + fromIndex,
-                               parentOffset + toIndex);
-            this.modCount = parent.modCount;
-            this.size -= toIndex - fromIndex;
+            root.removeRange(offset + fromIndex, offset + toIndex);
+            updateSizeAndModCount(fromIndex - toIndex);
         }
 
         public boolean addAll(Collection<? extends E> c) {
@@ -1123,11 +1108,9 @@
             int cSize = c.size();
             if (cSize==0)
                 return false;
-
             checkForComodification();
-            parent.addAll(parentOffset + index, c);
-            this.modCount = parent.modCount;
-            this.size += cSize;
+            root.addAll(offset + index, c);
+            updateSizeAndModCount(cSize);
             return true;
         }
 
@@ -1135,15 +1118,14 @@
             return listIterator();
         }
 
-        public ListIterator<E> listIterator(final int index) {
+        public ListIterator<E> listIterator(int index) {
             checkForComodification();
             rangeCheckForAdd(index);
-            final int offset = this.offset;
 
             return new ListIterator<E>() {
                 int cursor = index;
                 int lastRet = -1;
-                int expectedModCount = ArrayList.this.modCount;
+                int expectedModCount = root.modCount;
 
                 public boolean hasNext() {
                     return cursor != SubList.this.size;
@@ -1155,7 +1137,7 @@
                     int i = cursor;
                     if (i >= SubList.this.size)
                         throw new NoSuchElementException();
-                    Object[] elementData = ArrayList.this.elementData;
+                    Object[] elementData = root.elementData;
                     if (offset + i >= elementData.length)
                         throw new ConcurrentModificationException();
                     cursor = i + 1;
@@ -1172,7 +1154,7 @@
                     int i = cursor - 1;
                     if (i < 0)
                         throw new NoSuchElementException();
-                    Object[] elementData = ArrayList.this.elementData;
+                    Object[] elementData = root.elementData;
                     if (offset + i >= elementData.length)
                         throw new ConcurrentModificationException();
                     cursor = i;
@@ -1187,7 +1169,7 @@
                     if (i >= size) {
                         return;
                     }
-                    final Object[] elementData = ArrayList.this.elementData;
+                    final Object[] elementData = root.elementData;
                     if (offset + i >= elementData.length) {
                         throw new ConcurrentModificationException();
                     }
@@ -1216,7 +1198,7 @@
                         SubList.this.remove(lastRet);
                         cursor = lastRet;
                         lastRet = -1;
-                        expectedModCount = ArrayList.this.modCount;
+                        expectedModCount = root.modCount;
                     } catch (IndexOutOfBoundsException ex) {
                         throw new ConcurrentModificationException();
                     }
@@ -1228,7 +1210,7 @@
                     checkForComodification();
 
                     try {
-                        ArrayList.this.set(offset + lastRet, e);
+                        root.set(offset + lastRet, e);
                     } catch (IndexOutOfBoundsException ex) {
                         throw new ConcurrentModificationException();
                     }
@@ -1242,14 +1224,14 @@
                         SubList.this.add(i, e);
                         cursor = i + 1;
                         lastRet = -1;
-                        expectedModCount = ArrayList.this.modCount;
+                        expectedModCount = root.modCount;
                     } catch (IndexOutOfBoundsException ex) {
                         throw new ConcurrentModificationException();
                     }
                 }
 
                 final void checkForComodification() {
-                    if (expectedModCount != ArrayList.this.modCount)
+                    if (root.modCount != expectedModCount)
                         throw new ConcurrentModificationException();
                 }
             };
@@ -1257,12 +1239,7 @@
 
         public List<E> subList(int fromIndex, int toIndex) {
             subListRangeCheck(fromIndex, toIndex, size);
-            return new SubList(this, offset, fromIndex, toIndex);
-        }
-
-        private void rangeCheck(int index) {
-            if (index < 0 || index >= this.size)
-                throw new IndexOutOfBoundsException(outOfBoundsMsg(index));
+            return new SubList<>(this, fromIndex, toIndex);
         }
 
         private void rangeCheckForAdd(int index) {
@@ -1275,13 +1252,24 @@
         }
 
         private void checkForComodification() {
-            if (ArrayList.this.modCount != this.modCount)
+            if (root.modCount != modCount)
                 throw new ConcurrentModificationException();
         }
 
+        private void updateSizeAndModCount(int sizeChange) {
+            SubList<E> slist = this;
+            do {
+                slist.size += sizeChange;
+                slist.modCount = root.modCount;
+                slist = slist.parent;
+            } while (slist != null);
+        }
+
         public Spliterator<E> spliterator() {
             checkForComodification();
 
+            // ArrayListSpliterator is not used because late-binding logic
+            // is different here
             return new Spliterator<>() {
                 private int index = offset; // current index, modified on advance/split
                 private int fence = -1; // -1 until used; then one past last index
@@ -1298,8 +1286,9 @@
 
                 public ArrayListSpliterator<E> trySplit() {
                     int hi = getFence(), lo = index, mid = (lo + hi) >>> 1;
+                    // ArrayListSpliterator could be used here as the source is already bound
                     return (lo >= mid) ? null : // divide range in half unless too small
-                        new ArrayListSpliterator<>(ArrayList.this, lo, index = mid,
+                        new ArrayListSpliterator<>(root, lo, index = mid,
                                                    expectedModCount);
                 }
 
@@ -1308,9 +1297,9 @@
                     int hi = getFence(), i = index;
                     if (i < hi) {
                         index = i + 1;
-                        @SuppressWarnings("unchecked") E e = (E)elementData[i];
+                        @SuppressWarnings("unchecked") E e = (E)root.elementData[i];
                         action.accept(e);
-                        if (ArrayList.this.modCount != expectedModCount)
+                        if (root.modCount != expectedModCount)
                             throw new ConcurrentModificationException();
                         return true;
                     }
@@ -1320,7 +1309,7 @@
                 public void forEachRemaining(Consumer<? super E> action) {
                     Objects.requireNonNull(action);
                     int i, hi, mc; // hoist accesses and checks from loop
-                    ArrayList<E> lst = ArrayList.this;
+                    ArrayList<E> lst = root;
                     Object[] a;
                     if ((a = lst.elementData) != null) {
                         if ((hi = fence) < 0) {
--- a/src/java.base/share/classes/java/util/GregorianCalendar.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/java.base/share/classes/java/util/GregorianCalendar.java	Thu Mar 31 09:00:24 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1189,37 +1189,33 @@
         case HOUR:
         case HOUR_OF_DAY:
             {
-                int unit = max + 1; // 12 or 24 hours
-                int h = internalGet(field);
-                int nh = (h + amount) % unit;
-                if (nh < 0) {
-                    nh += unit;
+                int rolledValue = getRolledValue(internalGet(field), amount, min, max);
+                int hourOfDay = rolledValue;
+                if (field == HOUR && internalGet(AM_PM) == PM) {
+                    hourOfDay += 12;
                 }
-                time += ONE_HOUR * (nh - h);
 
-                // The day might have changed, which could happen if
-                // the daylight saving time transition brings it to
-                // the next day, although it's very unlikely. But we
-                // have to make sure not to change the larger fields.
+                // Create the current date/time value to perform wall-clock-based
+                // roll.
                 CalendarDate d = calsys.getCalendarDate(time, getZone());
-                if (internalGet(DAY_OF_MONTH) != d.getDayOfMonth()) {
-                    d.setDate(internalGet(YEAR),
-                              internalGet(MONTH) + 1,
-                              internalGet(DAY_OF_MONTH));
-                    if (field == HOUR) {
-                        assert (internalGet(AM_PM) == PM);
-                        d.addHours(+12); // restore PM
+                d.setHours(hourOfDay);
+                time = calsys.getTime(d);
+
+                // If we stay on the same wall-clock time, try the next or previous hour.
+                if (internalGet(HOUR_OF_DAY) == d.getHours()) {
+                    hourOfDay = getRolledValue(rolledValue, amount > 0 ? +1 : -1, min, max);
+                    if (field == HOUR && internalGet(AM_PM) == PM) {
+                        hourOfDay += 12;
                     }
+                    d.setHours(hourOfDay);
                     time = calsys.getTime(d);
                 }
-                int hourOfDay = d.getHours();
-                internalSet(field, hourOfDay % unit);
-                if (field == HOUR) {
-                    internalSet(HOUR_OF_DAY, hourOfDay);
-                } else {
-                    internalSet(AM_PM, hourOfDay / 12);
-                    internalSet(HOUR, hourOfDay % 12);
-                }
+                // Get the new hourOfDay value which might have changed due to a DST transition.
+                hourOfDay = d.getHours();
+                // Update the hour related fields
+                internalSet(HOUR_OF_DAY, hourOfDay);
+                internalSet(AM_PM, hourOfDay / 12);
+                internalSet(HOUR, hourOfDay % 12);
 
                 // Time zone offset and/or daylight saving might have changed.
                 int zoneOffset = d.getZoneOffset();
--- a/src/java.base/share/classes/java/util/concurrent/TimeUnit.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/java.base/share/classes/java/util/concurrent/TimeUnit.java	Thu Mar 31 09:00:24 2016 -0700
@@ -75,137 +75,94 @@
     /**
      * Time unit representing one thousandth of a microsecond.
      */
-    NANOSECONDS {
-        public long toNanos(long d)   { return d; }
-        public long toMicros(long d)  { return d/(C1/C0); }
-        public long toMillis(long d)  { return d/(C2/C0); }
-        public long toSeconds(long d) { return d/(C3/C0); }
-        public long toMinutes(long d) { return d/(C4/C0); }
-        public long toHours(long d)   { return d/(C5/C0); }
-        public long toDays(long d)    { return d/(C6/C0); }
-        public long convert(long d, TimeUnit u) { return u.toNanos(d); }
-        int excessNanos(long d, long m) { return (int)(d - (m*C2)); }
-    },
-
+    NANOSECONDS(TimeUnit.NANO_SCALE),
     /**
      * Time unit representing one thousandth of a millisecond.
      */
-    MICROSECONDS {
-        public long toNanos(long d)   { return x(d, C1/C0, MAX/(C1/C0)); }
-        public long toMicros(long d)  { return d; }
-        public long toMillis(long d)  { return d/(C2/C1); }
-        public long toSeconds(long d) { return d/(C3/C1); }
-        public long toMinutes(long d) { return d/(C4/C1); }
-        public long toHours(long d)   { return d/(C5/C1); }
-        public long toDays(long d)    { return d/(C6/C1); }
-        public long convert(long d, TimeUnit u) { return u.toMicros(d); }
-        int excessNanos(long d, long m) { return (int)((d*C1) - (m*C2)); }
-    },
-
+    MICROSECONDS(TimeUnit.MICRO_SCALE),
     /**
      * Time unit representing one thousandth of a second.
      */
-    MILLISECONDS {
-        public long toNanos(long d)   { return x(d, C2/C0, MAX/(C2/C0)); }
-        public long toMicros(long d)  { return x(d, C2/C1, MAX/(C2/C1)); }
-        public long toMillis(long d)  { return d; }
-        public long toSeconds(long d) { return d/(C3/C2); }
-        public long toMinutes(long d) { return d/(C4/C2); }
-        public long toHours(long d)   { return d/(C5/C2); }
-        public long toDays(long d)    { return d/(C6/C2); }
-        public long convert(long d, TimeUnit u) { return u.toMillis(d); }
-        int excessNanos(long d, long m) { return 0; }
-    },
-
+    MILLISECONDS(TimeUnit.MILLI_SCALE),
     /**
      * Time unit representing one second.
      */
-    SECONDS {
-        public long toNanos(long d)   { return x(d, C3/C0, MAX/(C3/C0)); }
-        public long toMicros(long d)  { return x(d, C3/C1, MAX/(C3/C1)); }
-        public long toMillis(long d)  { return x(d, C3/C2, MAX/(C3/C2)); }
-        public long toSeconds(long d) { return d; }
-        public long toMinutes(long d) { return d/(C4/C3); }
-        public long toHours(long d)   { return d/(C5/C3); }
-        public long toDays(long d)    { return d/(C6/C3); }
-        public long convert(long d, TimeUnit u) { return u.toSeconds(d); }
-        int excessNanos(long d, long m) { return 0; }
-    },
-
+    SECONDS(TimeUnit.SECOND_SCALE),
     /**
      * Time unit representing sixty seconds.
      * @since 1.6
      */
-    MINUTES {
-        public long toNanos(long d)   { return x(d, C4/C0, MAX/(C4/C0)); }
-        public long toMicros(long d)  { return x(d, C4/C1, MAX/(C4/C1)); }
-        public long toMillis(long d)  { return x(d, C4/C2, MAX/(C4/C2)); }
-        public long toSeconds(long d) { return x(d, C4/C3, MAX/(C4/C3)); }
-        public long toMinutes(long d) { return d; }
-        public long toHours(long d)   { return d/(C5/C4); }
-        public long toDays(long d)    { return d/(C6/C4); }
-        public long convert(long d, TimeUnit u) { return u.toMinutes(d); }
-        int excessNanos(long d, long m) { return 0; }
-    },
-
+    MINUTES(TimeUnit.MINUTE_SCALE),
     /**
      * Time unit representing sixty minutes.
      * @since 1.6
      */
-    HOURS {
-        public long toNanos(long d)   { return x(d, C5/C0, MAX/(C5/C0)); }
-        public long toMicros(long d)  { return x(d, C5/C1, MAX/(C5/C1)); }
-        public long toMillis(long d)  { return x(d, C5/C2, MAX/(C5/C2)); }
-        public long toSeconds(long d) { return x(d, C5/C3, MAX/(C5/C3)); }
-        public long toMinutes(long d) { return x(d, C5/C4, MAX/(C5/C4)); }
-        public long toHours(long d)   { return d; }
-        public long toDays(long d)    { return d/(C6/C5); }
-        public long convert(long d, TimeUnit u) { return u.toHours(d); }
-        int excessNanos(long d, long m) { return 0; }
-    },
-
+    HOURS(TimeUnit.HOUR_SCALE),
     /**
      * Time unit representing twenty four hours.
      * @since 1.6
      */
-    DAYS {
-        public long toNanos(long d)   { return x(d, C6/C0, MAX/(C6/C0)); }
-        public long toMicros(long d)  { return x(d, C6/C1, MAX/(C6/C1)); }
-        public long toMillis(long d)  { return x(d, C6/C2, MAX/(C6/C2)); }
-        public long toSeconds(long d) { return x(d, C6/C3, MAX/(C6/C3)); }
-        public long toMinutes(long d) { return x(d, C6/C4, MAX/(C6/C4)); }
-        public long toHours(long d)   { return x(d, C6/C5, MAX/(C6/C5)); }
-        public long toDays(long d)    { return d; }
-        public long convert(long d, TimeUnit u) { return u.toDays(d); }
-        int excessNanos(long d, long m) { return 0; }
-    };
+    DAYS(TimeUnit.DAY_SCALE);
 
-    // Handy constants for conversion methods
-    static final long C0 = 1L;
-    static final long C1 = C0 * 1000L;
-    static final long C2 = C1 * 1000L;
-    static final long C3 = C2 * 1000L;
-    static final long C4 = C3 * 60L;
-    static final long C5 = C4 * 60L;
-    static final long C6 = C5 * 24L;
+    // Scales as constants
+    private static final long NANO_SCALE   = 1L;
+    private static final long MICRO_SCALE  = 1000L * NANO_SCALE;
+    private static final long MILLI_SCALE  = 1000L * MICRO_SCALE;
+    private static final long SECOND_SCALE = 1000L * MILLI_SCALE;
+    private static final long MINUTE_SCALE = 60L * SECOND_SCALE;
+    private static final long HOUR_SCALE   = 60L * MINUTE_SCALE;
+    private static final long DAY_SCALE    = 24L * HOUR_SCALE;
 
-    static final long MAX = Long.MAX_VALUE;
+    /*
+     * Instances cache conversion ratios and saturation cutoffs for
+     * the units up through SECONDS. Other cases compute them, in
+     * method cvt.
+     */
+
+    private final long scale;
+    private final long maxNanos;
+    private final long maxMicros;
+    private final long maxMillis;
+    private final long maxSecs;
+    private final long microRatio;
+    private final int milliRatio;   // fits in 32 bits
+    private final int secRatio;     // fits in 32 bits
+
+    private TimeUnit(long s) {
+        this.scale = s;
+        this.maxNanos = Long.MAX_VALUE / s;
+        long ur = (s >= MICRO_SCALE) ? (s / MICRO_SCALE) : (MICRO_SCALE / s);
+        this.microRatio = ur;
+        this.maxMicros = Long.MAX_VALUE / ur;
+        long mr = (s >= MILLI_SCALE) ? (s / MILLI_SCALE) : (MILLI_SCALE / s);
+        this.milliRatio = (int)mr;
+        this.maxMillis = Long.MAX_VALUE / mr;
+        long sr = (s >= SECOND_SCALE) ? (s / SECOND_SCALE) : (SECOND_SCALE / s);
+        this.secRatio = (int)sr;
+        this.maxSecs = Long.MAX_VALUE / sr;
+    }
 
     /**
-     * Scale d by m, checking for overflow.
-     * This has a short name to make above code more readable.
+     * General conversion utility.
+     *
+     * @param d duration
+     * @param dst result unit scale
+     * @param src source unit scale
      */
-    static long x(long d, long m, long over) {
-        if (d > +over) return Long.MAX_VALUE;
-        if (d < -over) return Long.MIN_VALUE;
-        return d * m;
+    private static long cvt(long d, long dst, long src) {
+        long r, m;
+        if (src == dst)
+            return d;
+        else if (src < dst)
+            return d / (dst / src);
+        else if (d > (m = Long.MAX_VALUE / (r = src / dst)))
+            return Long.MAX_VALUE;
+        else if (d < -m)
+            return Long.MIN_VALUE;
+        else
+            return d * r;
     }
 
-    // To maintain full signature compatibility with 1.5, and to improve the
-    // clarity of the generated javadoc (see 6287639: Abstract methods in
-    // enum classes should not be listed as abstract), method convert
-    // etc. are not declared abstract but otherwise act as abstract methods.
-
     /**
      * Converts the given time duration in the given unit to this unit.
      * Conversions from finer to coarser granularities truncate, so
@@ -221,11 +178,17 @@
      * @param sourceDuration the time duration in the given {@code sourceUnit}
      * @param sourceUnit the unit of the {@code sourceDuration} argument
      * @return the converted duration in this unit,
-     * or {@code Long.MIN_VALUE} if conversion would negatively
-     * overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
+     * or {@code Long.MIN_VALUE} if conversion would negatively overflow,
+     * or {@code Long.MAX_VALUE} if it would positively overflow.
      */
     public long convert(long sourceDuration, TimeUnit sourceUnit) {
-        throw new AbstractMethodError();
+        switch (this) {
+        case NANOSECONDS:  return sourceUnit.toNanos(sourceDuration);
+        case MICROSECONDS: return sourceUnit.toMicros(sourceDuration);
+        case MILLISECONDS: return sourceUnit.toMillis(sourceDuration);
+        case SECONDS:      return sourceUnit.toSeconds(sourceDuration);
+        default: return cvt(sourceDuration, scale, sourceUnit.scale);
+        }
     }
 
     /**
@@ -233,11 +196,19 @@
      * {@link #convert(long, TimeUnit) NANOSECONDS.convert(duration, this)}.
      * @param duration the duration
      * @return the converted duration,
-     * or {@code Long.MIN_VALUE} if conversion would negatively
-     * overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
+     * or {@code Long.MIN_VALUE} if conversion would negatively overflow,
+     * or {@code Long.MAX_VALUE} if it would positively overflow.
      */
     public long toNanos(long duration) {
-        throw new AbstractMethodError();
+        long s, m;
+        if ((s = scale) == NANO_SCALE)
+            return duration;
+        else if (duration > (m = maxNanos))
+            return Long.MAX_VALUE;
+        else if (duration < -m)
+            return Long.MIN_VALUE;
+        else
+            return duration * s;
     }
 
     /**
@@ -245,11 +216,21 @@
      * {@link #convert(long, TimeUnit) MICROSECONDS.convert(duration, this)}.
      * @param duration the duration
      * @return the converted duration,
-     * or {@code Long.MIN_VALUE} if conversion would negatively
-     * overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
+     * or {@code Long.MIN_VALUE} if conversion would negatively overflow,
+     * or {@code Long.MAX_VALUE} if it would positively overflow.
      */
     public long toMicros(long duration) {
-        throw new AbstractMethodError();
+        long s, m;
+        if ((s = scale) == MICRO_SCALE)
+            return duration;
+        else if (s < MICRO_SCALE)
+            return duration / microRatio;
+        else if (duration > (m = maxMicros))
+            return Long.MAX_VALUE;
+        else if (duration < -m)
+            return Long.MIN_VALUE;
+        else
+            return duration * microRatio;
     }
 
     /**
@@ -257,11 +238,21 @@
      * {@link #convert(long, TimeUnit) MILLISECONDS.convert(duration, this)}.
      * @param duration the duration
      * @return the converted duration,
-     * or {@code Long.MIN_VALUE} if conversion would negatively
-     * overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
+     * or {@code Long.MIN_VALUE} if conversion would negatively overflow,
+     * or {@code Long.MAX_VALUE} if it would positively overflow.
      */
     public long toMillis(long duration) {
-        throw new AbstractMethodError();
+        long s, m;
+        if ((s = scale) == MILLI_SCALE)
+            return duration;
+        else if (s < MILLI_SCALE)
+            return duration / milliRatio;
+        else if (duration > (m = maxMillis))
+            return Long.MAX_VALUE;
+        else if (duration < -m)
+            return Long.MIN_VALUE;
+        else
+            return duration * milliRatio;
     }
 
     /**
@@ -269,11 +260,21 @@
      * {@link #convert(long, TimeUnit) SECONDS.convert(duration, this)}.
      * @param duration the duration
      * @return the converted duration,
-     * or {@code Long.MIN_VALUE} if conversion would negatively
-     * overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
+     * or {@code Long.MIN_VALUE} if conversion would negatively overflow,
+     * or {@code Long.MAX_VALUE} if it would positively overflow.
      */
     public long toSeconds(long duration) {
-        throw new AbstractMethodError();
+        long s, m;
+        if ((s = scale) == SECOND_SCALE)
+            return duration;
+        else if (s < SECOND_SCALE)
+            return duration / secRatio;
+        else if (duration > (m = maxSecs))
+            return Long.MAX_VALUE;
+        else if (duration < -m)
+            return Long.MIN_VALUE;
+        else
+            return duration * secRatio;
     }
 
     /**
@@ -281,12 +282,12 @@
      * {@link #convert(long, TimeUnit) MINUTES.convert(duration, this)}.
      * @param duration the duration
      * @return the converted duration,
-     * or {@code Long.MIN_VALUE} if conversion would negatively
-     * overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
+     * or {@code Long.MIN_VALUE} if conversion would negatively overflow,
+     * or {@code Long.MAX_VALUE} if it would positively overflow.
      * @since 1.6
      */
     public long toMinutes(long duration) {
-        throw new AbstractMethodError();
+        return cvt(duration, MINUTE_SCALE, scale);
     }
 
     /**
@@ -294,12 +295,12 @@
      * {@link #convert(long, TimeUnit) HOURS.convert(duration, this)}.
      * @param duration the duration
      * @return the converted duration,
-     * or {@code Long.MIN_VALUE} if conversion would negatively
-     * overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
+     * or {@code Long.MIN_VALUE} if conversion would negatively overflow,
+     * or {@code Long.MAX_VALUE} if it would positively overflow.
      * @since 1.6
      */
     public long toHours(long duration) {
-        throw new AbstractMethodError();
+        return cvt(duration, HOUR_SCALE, scale);
     }
 
     /**
@@ -310,7 +311,7 @@
      * @since 1.6
      */
     public long toDays(long duration) {
-        throw new AbstractMethodError();
+        return cvt(duration, DAY_SCALE, scale);
     }
 
     /**
@@ -320,7 +321,15 @@
      * @param m the number of milliseconds
      * @return the number of nanoseconds
      */
-    abstract int excessNanos(long d, long m);
+    private int excessNanos(long d, long m) {
+        long s;
+        if ((s = scale) == NANO_SCALE)
+            return (int)(d - (m * MILLI_SCALE));
+        else if (s == MICRO_SCALE)
+            return (int)((d * 1000L) - (m * MILLI_SCALE));
+        else
+            return 0;
+    }
 
     /**
      * Performs a timed {@link Object#wait(long, int) Object.wait}
--- a/src/java.base/share/classes/java/util/jar/JarFile.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/java.base/share/classes/java/util/jar/JarFile.java	Thu Mar 31 09:00:24 2016 -0700
@@ -28,7 +28,6 @@
 import java.io.*;
 import java.lang.ref.SoftReference;
 import java.net.URL;
-import java.security.PrivilegedAction;
 import java.util.*;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
@@ -38,11 +37,10 @@
 import java.security.AccessController;
 import java.security.CodeSource;
 import jdk.internal.misc.SharedSecrets;
+import sun.security.action.GetPropertyAction;
 import sun.security.util.ManifestEntryVerifier;
 import sun.security.util.SignatureFileVerifier;
 
-import static java.util.jar.Attributes.Name.MULTI_RELEASE;
-
 /**
  * The {@code JarFile} class is used to read the contents of a jar file
  * from any file that can be opened with {@code java.io.RandomAccessFile}.
@@ -144,8 +142,9 @@
     private final int version;
     private boolean notVersioned;
     private final boolean runtimeVersioned;
+    private boolean isMultiRelease;    // is jar multi-release?
 
-    // indicates if Class-Path attribute present (only valid if hasCheckedSpecialAttributes true)
+    // indicates if Class-Path attribute present
     private boolean hasClassPathAttribute;
     // true if manifest checked for special attributes
     private volatile boolean hasCheckedSpecialAttributes;
@@ -155,24 +154,18 @@
         SharedSecrets.setJavaUtilJarAccess(new JavaUtilJarAccessImpl());
 
         BASE_VERSION = 8;  // one less than lowest version for versioned entries
-        RUNTIME_VERSION = AccessController.doPrivileged(
-                new PrivilegedAction<Integer>() {
-                    public Integer run() {
-                        Integer v = jdk.Version.current().major();
-                        Integer i = Integer.getInteger("jdk.util.jar.version", v);
-                        i = i < 0 ? 0 : i;
-                        return i > v ? v : i;
-                    }
-                }
-        );
-        String multi_release = AccessController.doPrivileged(
-                new PrivilegedAction<String>() {
-                    public String run() {
-                        return System.getProperty("jdk.util.jar.enableMultiRelease", "true");
-                    }
-                }
-        );
-        switch (multi_release) {
+        int runtimeVersion = jdk.Version.current().major();
+        String jarVersion = AccessController.doPrivileged(
+                new GetPropertyAction("jdk.util.jar.version"));
+        if (jarVersion != null) {
+            int jarVer = Integer.parseInt(jarVersion);
+            runtimeVersion = (jarVer > runtimeVersion)
+                    ? runtimeVersion : Math.max(jarVer, 0);
+        }
+        RUNTIME_VERSION = runtimeVersion;
+        String enableMultiRelease = AccessController.doPrivileged(
+                new GetPropertyAction("jdk.util.jar.enableMultiRelease", "true"));
+        switch (enableMultiRelease) {
             case "true":
             default:
                 MULTI_RELEASE_ENABLED = true;
@@ -353,8 +346,14 @@
         Objects.requireNonNull(version);
         this.verify = verify;
         // version applies to multi-release jar files, ignored for regular jar files
-        this.version = MULTI_RELEASE_FORCED ? RUNTIME_VERSION : version.value();
+        if (MULTI_RELEASE_FORCED) {
+            this.version = RUNTIME_VERSION;
+            version = Release.RUNTIME;
+        } else {
+            this.version = version.value();
+        }
         this.runtimeVersioned = version == Release.RUNTIME;
+
         assert runtimeVersionExists();
     }
 
@@ -392,35 +391,18 @@
      * @since 9
      */
     public final boolean isMultiRelease() {
-        // do not call this code in a constructor because some subclasses use
-        // lazy loading of manifest so it won't be available at construction time
-        if (MULTI_RELEASE_ENABLED) {
-            // Doubled-checked locking pattern
-            Boolean result = isMultiRelease;
-            if (result == null) {
-                synchronized (this) {
-                    result = isMultiRelease;
-                    if (result == null) {
-                        Manifest man = null;
-                        try {
-                            man = getManifest();
-                        } catch (IOException e) {
-                            //Ignored, manifest cannot be read
-                        }
-                        isMultiRelease = result = (man != null)
-                                && man.getMainAttributes().containsKey(MULTI_RELEASE)
-                                ? Boolean.TRUE : Boolean.FALSE;
-                    }
-                }
+        if (isMultiRelease) {
+            return true;
+        }
+        if (MULTI_RELEASE_ENABLED && version != BASE_VERSION) {
+            try {
+                checkForSpecialAttributes();
+            } catch (IOException io) {
+                isMultiRelease = false;
             }
-            return result == Boolean.TRUE;
-        } else {
-            return false;
         }
+        return isMultiRelease;
     }
-    // the following field, isMultiRelease, should only be used in the method
-    // isMultiRelease(), like a static local
-    private volatile Boolean isMultiRelease;    // is jar multi-release?
 
     /**
      * Returns the jar file manifest, or {@code null} if none.
@@ -905,26 +887,44 @@
     }
 
     // Statics for hand-coded Boyer-Moore search
-    private static final char[] CLASSPATH_CHARS = {'c','l','a','s','s','-','p','a','t','h'};
-    // The bad character shift for "class-path"
-    private static final int[] CLASSPATH_LASTOCC;
-    // The good suffix shift for "class-path"
-    private static final int[] CLASSPATH_OPTOSFT;
+    private static final byte[] CLASSPATH_CHARS =
+            {'C','L','A','S','S','-','P','A','T','H', ':', ' '};
+
+    // The bad character shift for "class-path:"
+    private static final byte[] CLASSPATH_LASTOCC;
+
+    private static final byte[] MULTIRELEASE_CHARS =
+            {'M','U','L','T','I','-','R','E','L','E', 'A', 'S', 'E', ':', ' '};
+
+    // The bad character shift for "multi-release: "
+    private static final byte[] MULTIRELEASE_LASTOCC;
 
     static {
-        CLASSPATH_LASTOCC = new int[128];
-        CLASSPATH_OPTOSFT = new int[10];
-        CLASSPATH_LASTOCC[(int)'c'] = 1;
-        CLASSPATH_LASTOCC[(int)'l'] = 2;
-        CLASSPATH_LASTOCC[(int)'s'] = 5;
-        CLASSPATH_LASTOCC[(int)'-'] = 6;
-        CLASSPATH_LASTOCC[(int)'p'] = 7;
-        CLASSPATH_LASTOCC[(int)'a'] = 8;
-        CLASSPATH_LASTOCC[(int)'t'] = 9;
-        CLASSPATH_LASTOCC[(int)'h'] = 10;
-        for (int i=0; i<9; i++)
-            CLASSPATH_OPTOSFT[i] = 10;
-        CLASSPATH_OPTOSFT[9]=1;
+        CLASSPATH_LASTOCC = new byte[64];
+        CLASSPATH_LASTOCC[(int)'C' - 32] = 1;
+        CLASSPATH_LASTOCC[(int)'L' - 32] = 2;
+        CLASSPATH_LASTOCC[(int)'S' - 32] = 5;
+        CLASSPATH_LASTOCC[(int)'-' - 32] = 6;
+        CLASSPATH_LASTOCC[(int)'P' - 32] = 7;
+        CLASSPATH_LASTOCC[(int)'A' - 32] = 8;
+        CLASSPATH_LASTOCC[(int)'T' - 32] = 9;
+        CLASSPATH_LASTOCC[(int)'H' - 32] = 10;
+        CLASSPATH_LASTOCC[(int)':' - 32] = 11;
+        CLASSPATH_LASTOCC[(int)' ' - 32] = 12;
+
+        MULTIRELEASE_LASTOCC = new byte[64];
+        MULTIRELEASE_LASTOCC[(int)'M' - 32] = 1;
+        MULTIRELEASE_LASTOCC[(int)'U' - 32] = 2;
+        MULTIRELEASE_LASTOCC[(int)'T' - 32] = 4;
+        MULTIRELEASE_LASTOCC[(int)'I' - 32] = 5;
+        MULTIRELEASE_LASTOCC[(int)'-' - 32] = 6;
+        MULTIRELEASE_LASTOCC[(int)'R' - 32] = 7;
+        MULTIRELEASE_LASTOCC[(int)'L' - 32] = 9;
+        MULTIRELEASE_LASTOCC[(int)'A' - 32] = 11;
+        MULTIRELEASE_LASTOCC[(int)'S' - 32] = 12;
+        MULTIRELEASE_LASTOCC[(int)'E' - 32] = 13;
+        MULTIRELEASE_LASTOCC[(int)':' - 32] = 14;
+        MULTIRELEASE_LASTOCC[(int)' ' - 32] = 15;
     }
 
     private JarEntry getManEntry() {
@@ -962,22 +962,33 @@
 
     /**
      * Returns true if the pattern {@code src} is found in {@code b}.
-     * The {@code lastOcc} and {@code optoSft} arrays are the precomputed
-     * bad character and good suffix shifts.
+     * The {@code lastOcc} array is the precomputed bad character shifts.
+     * Since there are no repeated substring in our search strings,
+     * the good suffix shifts can be replaced with a comparison.
      */
-    private boolean match(char[] src, byte[] b, int[] lastOcc, int[] optoSft) {
+    private boolean match(byte[] src, byte[] b, byte[] lastOcc) {
         int len = src.length;
         int last = b.length - len;
         int i = 0;
         next:
-        while (i<=last) {
-            for (int j=(len-1); j>=0; j--) {
-                char c = (char) b[i+j];
-                c = (((c-'A')|('Z'-c)) >= 0) ? (char)(c + 32) : c;
-                if (c != src[j]) {
-                    i += Math.max(j + 1 - lastOcc[c&0x7F], optoSft[j]);
+        while (i <= last) {
+            for (int j = (len - 1); j >= 0; j--) {
+                byte c = b[i + j];
+                if (c >= ' ' && c <= 'z') {
+                    if (c >= 'a') c -= 32; // Canonicalize
+
+                    if (c != src[j]) {
+                        // no match
+                        int goodShift = (j < len - 1) ? len : 1;
+                        int badShift = lastOcc[c - 32];
+                        i += Math.max(j + 1 - badShift, goodShift);
+                        continue next;
+                    }
+                } else {
+                    // no match, character not valid for name
+                    i += len;
                     continue next;
-                 }
+                }
             }
             return true;
         }
@@ -986,17 +997,29 @@
 
     /**
      * On first invocation, check if the JAR file has the Class-Path
-     * attribute. A no-op on subsequent calls.
+     * and the Multi-Release attribute. A no-op on subsequent calls.
      */
     private void checkForSpecialAttributes() throws IOException {
-        if (hasCheckedSpecialAttributes) return;
-        JarEntry manEntry = getManEntry();
-        if (manEntry != null) {
-            byte[] b = getBytes(manEntry);
-            if (match(CLASSPATH_CHARS, b, CLASSPATH_LASTOCC, CLASSPATH_OPTOSFT))
-                hasClassPathAttribute = true;
+        if (hasCheckedSpecialAttributes) {
+            return;
         }
-        hasCheckedSpecialAttributes = true;
+        synchronized (this) {
+            if (hasCheckedSpecialAttributes) {
+                return;
+            }
+            JarEntry manEntry = getManEntry();
+            if (manEntry != null) {
+                byte[] b = getBytes(manEntry);
+                hasClassPathAttribute = match(CLASSPATH_CHARS, b,
+                        CLASSPATH_LASTOCC);
+                // is this a multi-release jar file
+                if (MULTI_RELEASE_ENABLED && version != BASE_VERSION) {
+                    isMultiRelease = match(MULTIRELEASE_CHARS, b,
+                            MULTIRELEASE_LASTOCC);
+                }
+            }
+            hasCheckedSpecialAttributes = true;
+        }
     }
 
     private synchronized void ensureInitialization() {
--- a/src/java.base/share/classes/java/util/jar/JarInputStream.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/java.base/share/classes/java/util/jar/JarInputStream.java	Thu Mar 31 09:00:24 2016 -0700
@@ -28,7 +28,7 @@
 import java.util.zip.*;
 import java.io.*;
 import sun.security.util.ManifestEntryVerifier;
-import sun.misc.JarIndex;
+import jdk.internal.util.jar.JarIndex;
 
 /**
  * The <code>JarInputStream</code> class is used to read the contents of
--- a/src/java.base/share/classes/java/util/jar/JarVerifier.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/java.base/share/classes/java/util/jar/JarVerifier.java	Thu Mar 31 09:00:24 2016 -0700
@@ -32,7 +32,7 @@
 import java.security.cert.CertificateException;
 import java.util.zip.ZipEntry;
 
-import sun.misc.JarIndex;
+import jdk.internal.util.jar.JarIndex;
 import sun.security.util.ManifestDigester;
 import sun.security.util.ManifestEntryVerifier;
 import sun.security.util.SignatureFileVerifier;
--- a/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java	Thu Mar 31 09:00:24 2016 -0700
@@ -65,8 +65,8 @@
 
 import jdk.internal.misc.JavaUtilZipFileAccess;
 import jdk.internal.misc.SharedSecrets;
-import sun.misc.InvalidJarIndexException;
-import sun.misc.JarIndex;
+import jdk.internal.util.jar.InvalidJarIndexError;
+import jdk.internal.util.jar.JarIndex;
 import sun.net.util.URLUtil;
 import sun.net.www.ParseUtil;
 
@@ -902,7 +902,7 @@
                          */
                         if (!newLoader.validIndex(name)) {
                             /* the mapping is wrong */
-                            throw new InvalidJarIndexException("Invalid index");
+                            throw new InvalidJarIndexError("Invalid index");
                         }
                     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/util/jar/InvalidJarIndexError.java	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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.util.jar;
+
+/**
+ * Thrown if the URLClassLoader finds the INDEX.LIST file of
+ * a jar file contains incorrect information.
+ *
+ * @since 9
+ */
+
+public class InvalidJarIndexError extends Error {
+
+    static final long serialVersionUID = 0L;
+
+    /**
+     * Constructs an {@code InvalidJarIndexError} with no detail message.
+     */
+    public InvalidJarIndexError() {
+        super();
+    }
+
+    /**
+     * Constructs an {@code InvalidJarIndexError} with the specified detail message.
+     *
+     * @param   s   the detail message.
+     */
+    public InvalidJarIndexError(String s) {
+        super(s);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/util/jar/JarIndex.java	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,333 @@
+/*
+ * Copyright (c) 1999, 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 jdk.internal.util.jar;
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import java.util.zip.*;
+
+/**
+ * This class is used to maintain mappings from packages, classes
+ * and resources to their enclosing JAR files. Mappings are kept
+ * at the package level except for class or resource files that
+ * are located at the root directory. URLClassLoader uses the mapping
+ * information to determine where to fetch an extension class or
+ * resource from.
+ *
+ * @author  Zhenghua Li
+ * @since   1.3
+ */
+
+public class JarIndex {
+
+    /**
+     * The hash map that maintains mappings from
+     * package/classe/resource to jar file list(s)
+     */
+    private HashMap<String,LinkedList<String>> indexMap;
+
+    /**
+     * The hash map that maintains mappings from
+     * jar file to package/class/resource lists
+     */
+    private HashMap<String,LinkedList<String>> jarMap;
+
+    /*
+     * An ordered list of jar file names.
+     */
+    private String[] jarFiles;
+
+    /**
+     * The index file name.
+     */
+    public static final String INDEX_NAME = "META-INF/INDEX.LIST";
+
+    /**
+     * true if, and only if, sun.misc.JarIndex.metaInfFilenames is set to true.
+     * If true, the names of the files in META-INF, and its subdirectories, will
+     * be added to the index. Otherwise, just the directory names are added.
+     */
+    private static final boolean metaInfFilenames =
+        "true".equals(System.getProperty("sun.misc.JarIndex.metaInfFilenames"));
+
+    /**
+     * Constructs a new, empty jar index.
+     */
+    public JarIndex() {
+        indexMap = new HashMap<>();
+        jarMap = new HashMap<>();
+    }
+
+    /**
+     * Constructs a new index from the specified input stream.
+     *
+     * @param is the input stream containing the index data
+     */
+    public JarIndex(InputStream is) throws IOException {
+        this();
+        read(is);
+    }
+
+    /**
+     * Constructs a new index for the specified list of jar files.
+     *
+     * @param files the list of jar files to construct the index from.
+     */
+    public JarIndex(String[] files) throws IOException {
+        this();
+        this.jarFiles = files;
+        parseJars(files);
+    }
+
+    /**
+     * Returns the jar index, or <code>null</code> if none.
+     *
+     * @param jar the JAR file to get the index from.
+     * @exception IOException if an I/O error has occurred.
+     */
+    public static JarIndex getJarIndex(JarFile jar) throws IOException {
+        JarIndex index = null;
+        JarEntry e = jar.getJarEntry(INDEX_NAME);
+        // if found, then load the index
+        if (e != null) {
+            index = new JarIndex(jar.getInputStream(e));
+        }
+        return index;
+    }
+
+    /**
+     * Returns the jar files that are defined in this index.
+     */
+    public String[] getJarFiles() {
+        return jarFiles;
+    }
+
+    /*
+     * Add the key, value pair to the hashmap, the value will
+     * be put in a linked list which is created if necessary.
+     */
+    private void addToList(String key, String value,
+                           HashMap<String,LinkedList<String>> t) {
+        LinkedList<String> list = t.get(key);
+        if (list == null) {
+            list = new LinkedList<>();
+            list.add(value);
+            t.put(key, list);
+        } else if (!list.contains(value)) {
+            list.add(value);
+        }
+    }
+
+    /**
+     * Returns the list of jar files that are mapped to the file.
+     *
+     * @param fileName the key of the mapping
+     */
+    public LinkedList<String> get(String fileName) {
+        LinkedList<String> jarFiles = null;
+        if ((jarFiles = indexMap.get(fileName)) == null) {
+            /* try the package name again */
+            int pos;
+            if((pos = fileName.lastIndexOf('/')) != -1) {
+                jarFiles = indexMap.get(fileName.substring(0, pos));
+            }
+        }
+        return jarFiles;
+    }
+
+    /**
+     * Add the mapping from the specified file to the specified
+     * jar file. If there were no mapping for the package of the
+     * specified file before, a new linked list will be created,
+     * the jar file is added to the list and a new mapping from
+     * the package to the jar file list is added to the hashmap.
+     * Otherwise, the jar file will be added to the end of the
+     * existing list.
+     *
+     * @param fileName the file name
+     * @param jarName the jar file that the file is mapped to
+     *
+     */
+    public void add(String fileName, String jarName) {
+        String packageName;
+        int pos;
+        if((pos = fileName.lastIndexOf('/')) != -1) {
+            packageName = fileName.substring(0, pos);
+        } else {
+            packageName = fileName;
+        }
+
+        addMapping(packageName, jarName);
+    }
+
+    /**
+     * Same as add(String,String) except that it doesn't strip off from the
+     * last index of '/'. It just adds the jarItem (filename or package)
+     * as it is received.
+     */
+    private void addMapping(String jarItem, String jarName) {
+        // add the mapping to indexMap
+        addToList(jarItem, jarName, indexMap);
+
+        // add the mapping to jarMap
+        addToList(jarName, jarItem, jarMap);
+     }
+
+    /**
+     * Go through all the jar files and construct the
+     * index table.
+     */
+    private void parseJars(String[] files) throws IOException {
+        if (files == null) {
+            return;
+        }
+
+        String currentJar = null;
+
+        for (int i = 0; i < files.length; i++) {
+            currentJar = files[i];
+            ZipFile zrf = new ZipFile(currentJar.replace
+                                      ('/', File.separatorChar));
+
+            Enumeration<? extends ZipEntry> entries = zrf.entries();
+            while(entries.hasMoreElements()) {
+                ZipEntry entry = entries.nextElement();
+                String fileName = entry.getName();
+
+                // Skip the META-INF directory, the index, and manifest.
+                // Any files in META-INF/ will be indexed explicitly
+                if (fileName.equals("META-INF/") ||
+                    fileName.equals(INDEX_NAME) ||
+                    fileName.equals(JarFile.MANIFEST_NAME))
+                    continue;
+
+                if (!metaInfFilenames || !fileName.startsWith("META-INF/")) {
+                    add(fileName, currentJar);
+                } else if (!entry.isDirectory()) {
+                        // Add files under META-INF explicitly so that certain
+                        // services, like ServiceLoader, etc, can be located
+                        // with greater accuracy. Directories can be skipped
+                        // since each file will be added explicitly.
+                        addMapping(fileName, currentJar);
+                }
+            }
+
+            zrf.close();
+        }
+    }
+
+    /**
+     * Writes the index to the specified OutputStream
+     *
+     * @param out the output stream
+     * @exception IOException if an I/O error has occurred
+     */
+    public void write(OutputStream out) throws IOException {
+        BufferedWriter bw = new BufferedWriter
+            (new OutputStreamWriter(out, "UTF8"));
+        bw.write("JarIndex-Version: 1.0\n\n");
+
+        if (jarFiles != null) {
+            for (int i = 0; i < jarFiles.length; i++) {
+                /* print out the jar file name */
+                String jar = jarFiles[i];
+                bw.write(jar + "\n");
+                LinkedList<String> jarlist = jarMap.get(jar);
+                if (jarlist != null) {
+                    Iterator<String> listitr = jarlist.iterator();
+                    while(listitr.hasNext()) {
+                        bw.write(listitr.next() + "\n");
+                    }
+                }
+                bw.write("\n");
+            }
+            bw.flush();
+        }
+    }
+
+
+    /**
+     * Reads the index from the specified InputStream.
+     *
+     * @param is the input stream
+     * @exception IOException if an I/O error has occurred
+     */
+    public void read(InputStream is) throws IOException {
+        BufferedReader br = new BufferedReader
+            (new InputStreamReader(is, "UTF8"));
+        String line = null;
+        String currentJar = null;
+
+        /* an ordered list of jar file names */
+        Vector<String> jars = new Vector<>();
+
+        /* read until we see a .jar line */
+        while((line = br.readLine()) != null && !line.endsWith(".jar"));
+
+        for(;line != null; line = br.readLine()) {
+            if (line.length() == 0)
+                continue;
+
+            if (line.endsWith(".jar")) {
+                currentJar = line;
+                jars.add(currentJar);
+            } else {
+                String name = line;
+                addMapping(name, currentJar);
+            }
+        }
+
+        jarFiles = jars.toArray(new String[jars.size()]);
+    }
+
+    /**
+     * Merges the current index into another index, taking into account
+     * the relative path of the current index.
+     *
+     * @param toIndex The destination index which the current index will
+     *                merge into.
+     * @param path    The relative path of the this index to the destination
+     *                index.
+     *
+     */
+    public void merge(JarIndex toIndex, String path) {
+        Iterator<Map.Entry<String,LinkedList<String>>> itr = indexMap.entrySet().iterator();
+        while(itr.hasNext()) {
+            Map.Entry<String,LinkedList<String>> e = itr.next();
+            String packageName = e.getKey();
+            LinkedList<String> from_list = e.getValue();
+            Iterator<String> listItr = from_list.iterator();
+            while(listItr.hasNext()) {
+                String jarName = listItr.next();
+                if (path != null) {
+                    jarName = path.concat(jarName);
+                }
+                toIndex.addMapping(packageName, jarName);
+            }
+        }
+    }
+}
--- a/src/java.base/share/classes/module-info.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/java.base/share/classes/module-info.java	Thu Mar 31 09:00:24 2016 -0700
@@ -180,6 +180,8 @@
         jdk.jvmstat;
     exports jdk.internal.ref to
         java.desktop;
+    exports jdk.internal.util.jar to
+        jdk.jartool;
     exports sun.net to
         java.httpclient;
     exports sun.net.dns to
--- a/src/java.base/share/classes/sun/misc/InvalidJarIndexException.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  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.misc;
-
-import java.lang.LinkageError;
-
-/**
- * Thrown if the URLClassLoader finds the INDEX.LIST file of
- * a jar file contains incorrect information.
- *
- * @author   Zhenghua Li
- * @since   1.3
- */
-
-public
-class InvalidJarIndexException extends RuntimeException {
-
-    static final long serialVersionUID = -6159797516569680148L;
-
-    /**
-     * Constructs an <code>InvalidJarIndexException</code> with no
-     * detail message.
-     */
-    public InvalidJarIndexException() {
-        super();
-    }
-
-    /**
-     * Constructs an <code>InvalidJarIndexException</code> with the
-     * specified detail message.
-     *
-     * @param   s   the detail message.
-     */
-    public InvalidJarIndexException(String s) {
-        super(s);
-    }
-}
--- a/src/java.base/share/classes/sun/misc/JarIndex.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,333 +0,0 @@
-/*
- * Copyright (c) 1999, 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 sun.misc;
-
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.zip.*;
-
-/**
- * This class is used to maintain mappings from packages, classes
- * and resources to their enclosing JAR files. Mappings are kept
- * at the package level except for class or resource files that
- * are located at the root directory. URLClassLoader uses the mapping
- * information to determine where to fetch an extension class or
- * resource from.
- *
- * @author  Zhenghua Li
- * @since   1.3
- */
-
-public class JarIndex {
-
-    /**
-     * The hash map that maintains mappings from
-     * package/classe/resource to jar file list(s)
-     */
-    private HashMap<String,LinkedList<String>> indexMap;
-
-    /**
-     * The hash map that maintains mappings from
-     * jar file to package/class/resource lists
-     */
-    private HashMap<String,LinkedList<String>> jarMap;
-
-    /*
-     * An ordered list of jar file names.
-     */
-    private String[] jarFiles;
-
-    /**
-     * The index file name.
-     */
-    public static final String INDEX_NAME = "META-INF/INDEX.LIST";
-
-    /**
-     * true if, and only if, sun.misc.JarIndex.metaInfFilenames is set to true.
-     * If true, the names of the files in META-INF, and its subdirectories, will
-     * be added to the index. Otherwise, just the directory names are added.
-     */
-    private static final boolean metaInfFilenames =
-        "true".equals(System.getProperty("sun.misc.JarIndex.metaInfFilenames"));
-
-    /**
-     * Constructs a new, empty jar index.
-     */
-    public JarIndex() {
-        indexMap = new HashMap<>();
-        jarMap = new HashMap<>();
-    }
-
-    /**
-     * Constructs a new index from the specified input stream.
-     *
-     * @param is the input stream containing the index data
-     */
-    public JarIndex(InputStream is) throws IOException {
-        this();
-        read(is);
-    }
-
-    /**
-     * Constructs a new index for the specified list of jar files.
-     *
-     * @param files the list of jar files to construct the index from.
-     */
-    public JarIndex(String[] files) throws IOException {
-        this();
-        this.jarFiles = files;
-        parseJars(files);
-    }
-
-    /**
-     * Returns the jar index, or <code>null</code> if none.
-     *
-     * @param jar the JAR file to get the index from.
-     * @exception IOException if an I/O error has occurred.
-     */
-    public static JarIndex getJarIndex(JarFile jar) throws IOException {
-        JarIndex index = null;
-        JarEntry e = jar.getJarEntry(INDEX_NAME);
-        // if found, then load the index
-        if (e != null) {
-            index = new JarIndex(jar.getInputStream(e));
-        }
-        return index;
-    }
-
-    /**
-     * Returns the jar files that are defined in this index.
-     */
-    public String[] getJarFiles() {
-        return jarFiles;
-    }
-
-    /*
-     * Add the key, value pair to the hashmap, the value will
-     * be put in a linked list which is created if necessary.
-     */
-    private void addToList(String key, String value,
-                           HashMap<String,LinkedList<String>> t) {
-        LinkedList<String> list = t.get(key);
-        if (list == null) {
-            list = new LinkedList<>();
-            list.add(value);
-            t.put(key, list);
-        } else if (!list.contains(value)) {
-            list.add(value);
-        }
-    }
-
-    /**
-     * Returns the list of jar files that are mapped to the file.
-     *
-     * @param fileName the key of the mapping
-     */
-    public LinkedList<String> get(String fileName) {
-        LinkedList<String> jarFiles = null;
-        if ((jarFiles = indexMap.get(fileName)) == null) {
-            /* try the package name again */
-            int pos;
-            if((pos = fileName.lastIndexOf('/')) != -1) {
-                jarFiles = indexMap.get(fileName.substring(0, pos));
-            }
-        }
-        return jarFiles;
-    }
-
-    /**
-     * Add the mapping from the specified file to the specified
-     * jar file. If there were no mapping for the package of the
-     * specified file before, a new linked list will be created,
-     * the jar file is added to the list and a new mapping from
-     * the package to the jar file list is added to the hashmap.
-     * Otherwise, the jar file will be added to the end of the
-     * existing list.
-     *
-     * @param fileName the file name
-     * @param jarName the jar file that the file is mapped to
-     *
-     */
-    public void add(String fileName, String jarName) {
-        String packageName;
-        int pos;
-        if((pos = fileName.lastIndexOf('/')) != -1) {
-            packageName = fileName.substring(0, pos);
-        } else {
-            packageName = fileName;
-        }
-
-        addMapping(packageName, jarName);
-    }
-
-    /**
-     * Same as add(String,String) except that it doesn't strip off from the
-     * last index of '/'. It just adds the jarItem (filename or package)
-     * as it is received.
-     */
-    private void addMapping(String jarItem, String jarName) {
-        // add the mapping to indexMap
-        addToList(jarItem, jarName, indexMap);
-
-        // add the mapping to jarMap
-        addToList(jarName, jarItem, jarMap);
-     }
-
-    /**
-     * Go through all the jar files and construct the
-     * index table.
-     */
-    private void parseJars(String[] files) throws IOException {
-        if (files == null) {
-            return;
-        }
-
-        String currentJar = null;
-
-        for (int i = 0; i < files.length; i++) {
-            currentJar = files[i];
-            ZipFile zrf = new ZipFile(currentJar.replace
-                                      ('/', File.separatorChar));
-
-            Enumeration<? extends ZipEntry> entries = zrf.entries();
-            while(entries.hasMoreElements()) {
-                ZipEntry entry = entries.nextElement();
-                String fileName = entry.getName();
-
-                // Skip the META-INF directory, the index, and manifest.
-                // Any files in META-INF/ will be indexed explicitly
-                if (fileName.equals("META-INF/") ||
-                    fileName.equals(INDEX_NAME) ||
-                    fileName.equals(JarFile.MANIFEST_NAME))
-                    continue;
-
-                if (!metaInfFilenames || !fileName.startsWith("META-INF/")) {
-                    add(fileName, currentJar);
-                } else if (!entry.isDirectory()) {
-                        // Add files under META-INF explicitly so that certain
-                        // services, like ServiceLoader, etc, can be located
-                        // with greater accuracy. Directories can be skipped
-                        // since each file will be added explicitly.
-                        addMapping(fileName, currentJar);
-                }
-            }
-
-            zrf.close();
-        }
-    }
-
-    /**
-     * Writes the index to the specified OutputStream
-     *
-     * @param out the output stream
-     * @exception IOException if an I/O error has occurred
-     */
-    public void write(OutputStream out) throws IOException {
-        BufferedWriter bw = new BufferedWriter
-            (new OutputStreamWriter(out, "UTF8"));
-        bw.write("JarIndex-Version: 1.0\n\n");
-
-        if (jarFiles != null) {
-            for (int i = 0; i < jarFiles.length; i++) {
-                /* print out the jar file name */
-                String jar = jarFiles[i];
-                bw.write(jar + "\n");
-                LinkedList<String> jarlist = jarMap.get(jar);
-                if (jarlist != null) {
-                    Iterator<String> listitr = jarlist.iterator();
-                    while(listitr.hasNext()) {
-                        bw.write(listitr.next() + "\n");
-                    }
-                }
-                bw.write("\n");
-            }
-            bw.flush();
-        }
-    }
-
-
-    /**
-     * Reads the index from the specified InputStream.
-     *
-     * @param is the input stream
-     * @exception IOException if an I/O error has occurred
-     */
-    public void read(InputStream is) throws IOException {
-        BufferedReader br = new BufferedReader
-            (new InputStreamReader(is, "UTF8"));
-        String line = null;
-        String currentJar = null;
-
-        /* an ordered list of jar file names */
-        Vector<String> jars = new Vector<>();
-
-        /* read until we see a .jar line */
-        while((line = br.readLine()) != null && !line.endsWith(".jar"));
-
-        for(;line != null; line = br.readLine()) {
-            if (line.length() == 0)
-                continue;
-
-            if (line.endsWith(".jar")) {
-                currentJar = line;
-                jars.add(currentJar);
-            } else {
-                String name = line;
-                addMapping(name, currentJar);
-            }
-        }
-
-        jarFiles = jars.toArray(new String[jars.size()]);
-    }
-
-    /**
-     * Merges the current index into another index, taking into account
-     * the relative path of the current index.
-     *
-     * @param toIndex The destination index which the current index will
-     *                merge into.
-     * @param path    The relative path of the this index to the destination
-     *                index.
-     *
-     */
-    public void merge(JarIndex toIndex, String path) {
-        Iterator<Map.Entry<String,LinkedList<String>>> itr = indexMap.entrySet().iterator();
-        while(itr.hasNext()) {
-            Map.Entry<String,LinkedList<String>> e = itr.next();
-            String packageName = e.getKey();
-            LinkedList<String> from_list = e.getValue();
-            Iterator<String> listItr = from_list.iterator();
-            while(listItr.hasNext()) {
-                String jarName = listItr.next();
-                if (path != null) {
-                    jarName = path.concat(jarName);
-                }
-                toIndex.addMapping(packageName, jarName);
-            }
-        }
-    }
-}
--- a/src/java.base/share/classes/sun/misc/resources/Messages.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2002, 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.  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.misc.resources;
-
-/**
- * This class represents the {@code ResourceBundle}
- * for sun.misc.
- *
- * @author Michael Colburn
- */
-
-public class Messages extends java.util.ListResourceBundle {
-
-    /**
-     * Returns the contents of this {@code ResourceBundle}.
-     *
-     * @return the contents of this {@code ResourceBundle}.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-
-    private static final Object[][] contents = {
-        { "optpkg.versionerror", "ERROR: Invalid version format used in {0} JAR file. Check the documentation for the supported version format." },
-        { "optpkg.attributeerror", "ERROR: The required {0} JAR manifest attribute is not set in {1} JAR file." },
-        { "optpkg.attributeserror", "ERROR: Some required JAR manifest attributes are not set in {0} JAR file." }
-    };
-
-}
--- a/src/java.base/share/classes/sun/misc/resources/Messages_de.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * 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
- * 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.misc.resources;
-
-/**
- * This class represents the {@code ResourceBundle}
- * for sun.misc.
- *
- * @author Michael Colburn
- */
-
-public class Messages_de extends java.util.ListResourceBundle {
-
-    /**
-     * Returns the contents of this {@code ResourceBundle}.
-     *
-     * @return the contents of this {@code ResourceBundle}.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-
-    private static final Object[][] contents = {
-        { "optpkg.versionerror", "ERROR: In JAR-Datei {0} wurde ein ung\u00FCltiges Versionsformat verwendet. Pr\u00FCfen Sie in der Dokumentation, welches Versionsformat unterst\u00FCtzt wird." },
-        { "optpkg.attributeerror", "ERROR: In JAR-Datei {1} ist das erforderliche JAR-Manifestattribut {0} nicht festgelegt." },
-        { "optpkg.attributeserror", "ERROR: In JAR-Datei {0} sind einige erforderliche JAR-Manifestattribute nicht festgelegt." }
-    };
-
-}
--- a/src/java.base/share/classes/sun/misc/resources/Messages_es.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * 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
- * 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.misc.resources;
-
-/**
- * This class represents the {@code ResourceBundle}
- * for sun.misc.
- *
- * @author Michael Colburn
- */
-
-public class Messages_es extends java.util.ListResourceBundle {
-
-    /**
-     * Returns the contents of this {@code ResourceBundle}.
-     *
-     * @return the contents of this {@code ResourceBundle}.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-
-    private static final Object[][] contents = {
-        { "optpkg.versionerror", "ERROR: el formato del archivo JAR {0} pertenece a una versi\u00F3n no v\u00E1lida. Busque en la documentaci\u00F3n el formato de una versi\u00F3n soportada." },
-        { "optpkg.attributeerror", "ERROR: el atributo obligatorio JAR manifest {0} no est\u00E1 definido en el archivo JAR {1}." },
-        { "optpkg.attributeserror", "ERROR: algunos atributos obligatorios JAR manifest no est\u00E1n definidos en el archivo JAR {0}." }
-    };
-
-}
--- a/src/java.base/share/classes/sun/misc/resources/Messages_fr.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * 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
- * 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.misc.resources;
-
-/**
- * This class represents the {@code ResourceBundle}
- * for sun.misc.
- *
- * @author Michael Colburn
- */
-
-public class Messages_fr extends java.util.ListResourceBundle {
-
-    /**
-     * Returns the contents of this {@code ResourceBundle}.
-     *
-     * @return the contents of this {@code ResourceBundle}.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-
-    private static final Object[][] contents = {
-        { "optpkg.versionerror", "ERREUR\u00A0: le format de version utilis\u00E9 pour le fichier JAR {0} n''est pas valide. Pour conna\u00EEtre le format de version pris en charge, consultez la documentation." },
-        { "optpkg.attributeerror", "ERREUR\u00A0: l''attribut manifest JAR {0} obligatoire n''est pas d\u00E9fini dans le fichier JAR {1}." },
-        { "optpkg.attributeserror", "ERREUR\u00A0: certains attributs manifest JAR obligatoires ne sont pas d\u00E9finis dans le fichier JAR {0}." }
-    };
-
-}
--- a/src/java.base/share/classes/sun/misc/resources/Messages_it.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * 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
- * 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.misc.resources;
-
-/**
- * This class represents the {@code ResourceBundle}
- * for sun.misc.
- *
- * @author Michael Colburn
- */
-
-public class Messages_it extends java.util.ListResourceBundle {
-
-    /**
-     * Returns the contents of this {@code ResourceBundle}.
-     *
-     * @return the contents of this {@code ResourceBundle}.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-
-    private static final Object[][] contents = {
-        { "optpkg.versionerror", "ERRORE: Formato versione non valido nel file JAR {0}. Verificare nella documentazione il formato della versione supportato." },
-        { "optpkg.attributeerror", "ERRORE: L''attributo manifest JAR {0} richiesto non \u00E8 impostato nel file JAR {1}." },
-        { "optpkg.attributeserror", "ERRORE: Alcuni attributi manifesti JAR obbligatori non sono impostati nel file JAR {0}." }
-    };
-
-}
--- a/src/java.base/share/classes/sun/misc/resources/Messages_ja.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * 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
- * 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.misc.resources;
-
-/**
- * This class represents the {@code ResourceBundle}
- * for sun.misc.
- *
- * @author Michael Colburn
- */
-
-public class Messages_ja extends java.util.ListResourceBundle {
-
-    /**
-     * Returns the contents of this {@code ResourceBundle}.
-     *
-     * @return the contents of this {@code ResourceBundle}.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-
-    private static final Object[][] contents = {
-        { "optpkg.versionerror", "\u30A8\u30E9\u30FC: JAR\u30D5\u30A1\u30A4\u30EB{0}\u3067\u7121\u52B9\u306A\u30D0\u30FC\u30B8\u30E7\u30F3\u5F62\u5F0F\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u308B\u30D0\u30FC\u30B8\u30E7\u30F3\u5F62\u5F0F\u306B\u3064\u3044\u3066\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002" },
-        { "optpkg.attributeerror", "\u30A8\u30E9\u30FC: \u5FC5\u8981\u306AJAR\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u5C5E\u6027{0}\u304CJAR\u30D5\u30A1\u30A4\u30EB{1}\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002" },
-        { "optpkg.attributeserror", "\u30A8\u30E9\u30FC: \u8907\u6570\u306E\u5FC5\u8981\u306AJAR\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u5C5E\u6027\u304CJAR\u30D5\u30A1\u30A4\u30EB{0}\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002" }
-    };
-
-}
--- a/src/java.base/share/classes/sun/misc/resources/Messages_ko.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * 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
- * 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.misc.resources;
-
-/**
- * This class represents the {@code ResourceBundle}
- * for sun.misc.
- *
- * @author Michael Colburn
- */
-
-public class Messages_ko extends java.util.ListResourceBundle {
-
-    /**
-     * Returns the contents of this {@code ResourceBundle}.
-     *
-     * @return the contents of this {@code ResourceBundle}.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-
-    private static final Object[][] contents = {
-        { "optpkg.versionerror", "\uC624\uB958: {0} JAR \uD30C\uC77C\uC5D0 \uBD80\uC801\uD569\uD55C \uBC84\uC804 \uD615\uC2DD\uC774 \uC0AC\uC6A9\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC124\uBA85\uC11C\uC5D0\uC11C \uC9C0\uC6D0\uB418\uB294 \uBC84\uC804 \uD615\uC2DD\uC744 \uD655\uC778\uD558\uC2ED\uC2DC\uC624." },
-        { "optpkg.attributeerror", "\uC624\uB958: \uD544\uC694\uD55C {0} JAR manifest \uC18D\uC131\uC774 {1} JAR \uD30C\uC77C\uC5D0 \uC124\uC815\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." },
-        { "optpkg.attributeserror", "\uC624\uB958: \uD544\uC694\uD55C \uC77C\uBD80 JAR manifest \uC18D\uC131\uC774 {0} JAR \uD30C\uC77C\uC5D0 \uC124\uC815\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." }
-    };
-
-}
--- a/src/java.base/share/classes/sun/misc/resources/Messages_pt_BR.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * 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
- * 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.misc.resources;
-
-/**
- * This class represents the {@code ResourceBundle}
- * for sun.misc.
- *
- * @author Michael Colburn
- */
-
-public class Messages_pt_BR extends java.util.ListResourceBundle {
-
-    /**
-     * Returns the contents of this {@code ResourceBundle}.
-     *
-     * @return the contents of this {@code ResourceBundle}.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-
-    private static final Object[][] contents = {
-        { "optpkg.versionerror", "ERRO: formato de vers\u00E3o inv\u00E1lido usado no arquivo JAR {0}. Verifique a documenta\u00E7\u00E3o para obter o formato de vers\u00E3o suportado." },
-        { "optpkg.attributeerror", "ERRO: o atributo de manifesto JAR {0} necess\u00E1rio n\u00E3o est\u00E1 definido no arquivo JAR {1}." },
-        { "optpkg.attributeserror", "ERRO: alguns atributos de manifesto JAR necess\u00E1rios n\u00E3o est\u00E3o definidos no arquivo JAR {0}." }
-    };
-
-}
--- a/src/java.base/share/classes/sun/misc/resources/Messages_sv.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * 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
- * 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.misc.resources;
-
-/**
- * This class represents the {@code ResourceBundle}
- * for sun.misc.
- *
- * @author Michael Colburn
- */
-
-public class Messages_sv extends java.util.ListResourceBundle {
-
-    /**
-     * Returns the contents of this {@code ResourceBundle}.
-     *
-     * @return the contents of this {@code ResourceBundle}.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-
-    private static final Object[][] contents = {
-        { "optpkg.versionerror", "FEL: Ogiltigt versionsformat i {0} JAR-fil. Kontrollera i dokumentationen vilket versionsformat som st\u00F6ds." },
-        { "optpkg.attributeerror", "FEL: Obligatoriskt JAR manifest-attribut {0} \u00E4r inte inst\u00E4llt i {1} JAR-filen." },
-        { "optpkg.attributeserror", "FEL: Vissa obligatoriska JAR manifest-attribut \u00E4r inte inst\u00E4llda i {0} JAR-filen." }
-    };
-
-}
--- a/src/java.base/share/classes/sun/misc/resources/Messages_zh_CN.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * 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
- * 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.misc.resources;
-
-/**
- * This class represents the {@code ResourceBundle}
- * for sun.misc.
- *
- * @author Michael Colburn
- */
-
-public class Messages_zh_CN extends java.util.ListResourceBundle {
-
-    /**
-     * Returns the contents of this {@code ResourceBundle}.
-     *
-     * @return the contents of this {@code ResourceBundle}.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-
-    private static final Object[][] contents = {
-        { "optpkg.versionerror", "\u9519\u8BEF: {0} JAR \u6587\u4EF6\u4E2D\u4F7F\u7528\u7684\u7248\u672C\u683C\u5F0F\u65E0\u6548\u3002\u8BF7\u68C0\u67E5\u6587\u6863\u4EE5\u4E86\u89E3\u652F\u6301\u7684\u7248\u672C\u683C\u5F0F\u3002" },
-        { "optpkg.attributeerror", "\u9519\u8BEF: \u5FC5\u8981\u7684{0} JAR \u6E05\u5355\u5C5E\u6027\u672A\u5728{1} JAR \u6587\u4EF6\u4E2D\u8BBE\u7F6E\u3002" },
-        { "optpkg.attributeserror", "\u9519\u8BEF: \u67D0\u4E9B\u5FC5\u8981\u7684 JAR \u6E05\u5355\u5C5E\u6027\u672A\u5728{0} JAR \u6587\u4EF6\u4E2D\u8BBE\u7F6E\u3002" }
-    };
-
-}
--- a/src/java.base/share/classes/sun/misc/resources/Messages_zh_TW.java	Thu Mar 31 01:13:26 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * 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
- * 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.misc.resources;
-
-/**
- * This class represents the {@code ResourceBundle}
- * for sun.misc.
- *
- * @author Michael Colburn
- */
-
-public class Messages_zh_TW extends java.util.ListResourceBundle {
-
-    /**
-     * Returns the contents of this {@code ResourceBundle}.
-     *
-     * @return the contents of this {@code ResourceBundle}.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-
-    private static final Object[][] contents = {
-        { "optpkg.versionerror", "\u932F\u8AA4: {0} JAR \u6A94\u4F7F\u7528\u4E86\u7121\u6548\u7684\u7248\u672C\u683C\u5F0F\u3002\u8ACB\u6AA2\u67E5\u6587\u4EF6\uFF0C\u4EE5\u7372\u5F97\u652F\u63F4\u7684\u7248\u672C\u683C\u5F0F\u3002" },
-        { "optpkg.attributeerror", "\u932F\u8AA4: {1} JAR \u6A94\u4E2D\u672A\u8A2D\u5B9A\u5FC5\u8981\u7684 {0} JAR \u8CC7\u8A0A\u6E05\u55AE\u5C6C\u6027\u3002" },
-        { "optpkg.attributeserror", "\u932F\u8AA4: {0} JAR \u6A94\u4E2D\u672A\u8A2D\u5B9A\u67D0\u4E9B\u5FC5\u8981\u7684 JAR \u8CC7\u8A0A\u6E05\u55AE\u5C6C\u6027\u3002" }
-    };
-
-}
--- a/src/jdk.jartool/share/classes/sun/tools/jar/Main.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/jdk.jartool/share/classes/sun/tools/jar/Main.java	Thu Mar 31 09:00:24 2016 -0700
@@ -51,8 +51,8 @@
 
 import jdk.internal.module.Hasher;
 import jdk.internal.module.ModuleInfoExtender;
-import sun.misc.JarIndex;
-import static sun.misc.JarIndex.INDEX_NAME;
+import jdk.internal.util.jar.JarIndex;
+import static jdk.internal.util.jar.JarIndex.INDEX_NAME;
 import static java.util.jar.JarFile.MANIFEST_NAME;
 import static java.util.stream.Collectors.joining;
 import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java	Thu Mar 31 09:00:24 2016 -0700
@@ -46,6 +46,7 @@
 import jdk.tools.jlink.internal.Archive.Entry.EntryType;
 import jdk.tools.jlink.internal.PoolImpl.CompressedModuleData;
 import jdk.tools.jlink.plugin.ExecutableImage;
+import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.Pool;
 import jdk.tools.jlink.plugin.Pool.ModuleData;
 import jdk.tools.jlink.plugin.Pool.ModuleDataType;
@@ -183,6 +184,8 @@
         PoolImpl resultResources;
         try {
             resultResources = pluginSupport.visitResources(allContent);
+        } catch (PluginException pe) {
+            throw pe;
         } catch (Exception ex) {
             throw new IOException(ex);
         }
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java	Thu Mar 31 09:00:24 2016 -0700
@@ -92,6 +92,7 @@
         "*sun/text/resources/cldr/ext/[^\\/]+_%%.class," +
         "*sun/util/resources/cldr/ext/[^\\/]+_%%.class,";
     private Predicate<String> predicate;
+    private String userParam;
     private List<Locale.LanguageRange> priorityList;
     private List<Locale> available;
     private List<String> filtered;
@@ -155,13 +156,17 @@
 
     @Override
     public void configure(Map<String, String> config) {
-        try {
-            priorityList = Arrays.stream(config.get(NAME).split(","))
-                .map(Locale.LanguageRange::new)
-                .collect(Collectors.toList());
-        } catch (IllegalArgumentException iae) {
-            throw new PluginException(iae.getLocalizedMessage());
-        }
+        userParam = config.get(NAME);
+        priorityList = Arrays.stream(userParam.split(","))
+            .map(s -> {
+                try {
+                    return new Locale.LanguageRange(s);
+                } catch (IllegalArgumentException iae) {
+                    throw new PluginException(String.format(
+                        PluginsResourceBundle.getMessage(NAME + ".invalidtag"), s));
+                }
+            })
+            .collect(Collectors.toList());
     }
 
     @Override
@@ -191,7 +196,8 @@
         filtered = filterLocales(available);
 
         if (filtered.isEmpty()) {
-            throw new PluginException(PluginsResourceBundle.getMessage(NAME + ".nomatchinglocales"));
+            throw new PluginException(
+                String.format(PluginsResourceBundle.getMessage(NAME + ".nomatchinglocales"), userParam));
         }
 
         try {
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties	Thu Mar 31 01:13:26 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties	Thu Mar 31 09:00:24 2016 -0700
@@ -20,7 +20,7 @@
 Level 1: ZIP\n\
 Level 2: both.\n\
 An optional filter can be specified to list the pattern of files to be filtered.\n\
-Use ^ for negation. eg: *Exception.class,*Error.class,^/java.base/java/lang/*
+Use ^ for negation. e.g.: *Exception.class,*Error.class,^/java.base/java/lang/*
 
 compact-cp.argument=<resource paths>
 
@@ -32,17 +32,17 @@
 
 copy-files.description=\
 If files to copy are not absolute path, JDK home dir is used.\n\
-eg: jrt-fs.jar,LICENSE,/home/me/myfile.txt=somewehere/conf.txt
+e.g.: jrt-fs.jar,LICENSE,/home/me/myfile.txt=somewehere/conf.txt
 
 exclude-files.argument=<files to exclude | files of excluded files>
 
 exclude-files.description=\
-Specify files to exclude. eg: *.diz, /java.base/native/client/*
+Specify files to exclude. e.g.: *.diz, /java.base/native/client/*
 
 exclude-resources.argument=<resources to exclude | file of excluded resources>
 
 exclude-resources.description=\
-Specify resources to exclude. eg: *.jcov, */META-INF/*
+Specify resources to exclude. e.g.: *.jcov, */META-INF/*
 
 installed-modules.description=Fast loading of module descriptors (always enabled)
 
@@ -51,7 +51,7 @@
 sort-resources.argument=<paths in priority order | file with resource paths>
 
 sort-resources.description=\
-Sort resources. eg: */modules-info.class,/java-base/java/lang/*
+Sort resources. e.g.: */modules-info.class,/java-base/java/lang/*
 
 strip-debug.description=\
 Strip debug information from the output image
@@ -73,13 +73,16 @@
 
 include-locales.description=\
 BCP 47 language tags separated by a comma, allowing locale matching\n\
-defined in RFC 4647. eg: en,ja,*-IN
+defined in RFC 4647. e.g.: en,ja,*-IN
 
 include-locales.missingpackages=\
 Missing locale data packages in jdk.localedata:\n\t
 
 include-locales.nomatchinglocales=\
-No matching locales found. Check the specified pattern.
+No matching locales found for \"%s\". Check the specified pattern.
+
+include-locales.invalidtag=\
+Invalid language tag: %s
 
 main.status.ok=Functional.
 
--- a/test/Makefile	Thu Mar 31 01:13:26 2016 -0700
+++ b/test/Makefile	Thu Mar 31 09:00:24 2016 -0700
@@ -302,6 +302,8 @@
 # Set the max memory for jtreg control vm
 JTREG_MEMORY_OPTION = -J-Xmx512m
 JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
+# Give tests access to JT_JAVA, see JDK-8141609
+JTREG_BASIC_OPTIONS += -e:JDK8_HOME=${JT_JAVA}
 # Add any extra options
 JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
 # Set other vm and test options
--- a/test/ProblemList.txt	Thu Mar 31 01:13:26 2016 -0700
+++ b/test/ProblemList.txt	Thu Mar 31 09:00:24 2016 -0700
@@ -116,221 +116,184 @@
 
 # jdk_beans
 
-# 8060027
-java/beans/XMLEncoder/Test4903007.java                        generic-all
-java/beans/XMLEncoder/java_awt_GridBagLayout.java             generic-all
-java/beans/XMLDecoder/8028054/TestConstructorFinder.java      generic-all
-java/beans/XMLDecoder/8028054/TestMethodFinder.java           generic-all
+java/beans/XMLEncoder/Test4903007.java                          8060027 generic-all
+java/beans/XMLEncoder/java_awt_GridBagLayout.java               8060027 generic-all
+java/beans/XMLDecoder/8028054/TestConstructorFinder.java        8060027 generic-all
+java/beans/XMLDecoder/8028054/TestMethodFinder.java             8060027 generic-all
 
-# 8132565
-java/beans/Introspector/8132566/OverridePropertyInfoTest.java generic-all
-java/beans/Introspector/8132566/OverrideUserDefPropertyInfoTest.java generic-all
+java/beans/Introspector/8132566/OverridePropertyInfoTest.java   8132565 generic-all
+java/beans/Introspector/8132566/OverrideUserDefPropertyInfoTest.java 8132565 generic-all
 
 ############################################################################
 
 # jdk_lang
 
-# 8029891
-java/lang/ClassLoader/deadlock/GetResource.java                 generic-all
+java/lang/ClassLoader/deadlock/GetResource.java                 8029891 generic-all
 
-# 7008363
-java/lang/StringCoding/CheckEncodings.sh                        generic-all
+java/lang/StringCoding/CheckEncodings.sh                        7008363 generic-all
 
 ############################################################################
 
 # jdk_instrument
 
-# 8061177
-java/lang/instrument/RedefineBigClass.sh                        generic-all
-java/lang/instrument/RetransformBigClass.sh                     generic-all
+java/lang/instrument/RedefineBigClass.sh                        8061177 generic-all
+java/lang/instrument/RetransformBigClass.sh                     8061177 generic-all
 
-# 8072130
-java/lang/instrument/BootClassPath/BootClassPathTest.sh         macosx-all
+java/lang/instrument/BootClassPath/BootClassPathTest.sh         8072130 macosx-all
 
-# 8130339
-java/lang/management/MemoryMXBean/LowMemoryTest.java		generic-all
+java/lang/management/MemoryMXBean/LowMemoryTest.java            8130339 generic-all
 
 ############################################################################
 
 # jdk_jmx
 
-# 8030957
-com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java aix-all
-com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java  aix-all
-javax/management/MBeanServer/OldMBeanServerTest.java            aix-all
+com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java 8030957 aix-all
+com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java  8030957 aix-all
+javax/management/MBeanServer/OldMBeanServerTest.java            8030957 aix-all
 
-# 8042215
-javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java			generic-all
+javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java 8042215 generic-all
 
-# 8147985
-sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java generic-all
+sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java 8147985 generic-all
 
 ############################################################################
 
 # jdk_net
 
-# 7148829
-sun/net/InetAddress/nameservice/simple/CacheTest.java		generic-all
-sun/net/InetAddress/nameservice/simple/DefaultCaching.java	generic-all
+sun/net/InetAddress/nameservice/simple/CacheTest.java           7148829 generic-all
+sun/net/InetAddress/nameservice/simple/DefaultCaching.java      7148829 generic-all
 
-# 7122846
-java/net/MulticastSocket/NoLoopbackPackets.java                  macosx-all
-java/net/MulticastSocket/SetLoopbackMode.java                    macosx-all
+java/net/MulticastSocket/NoLoopbackPackets.java                 7122846 macosx-all
+java/net/MulticastSocket/SetLoopbackMode.java                   7122846 macosx-all
 
-# 7145658
-java/net/MulticastSocket/Test.java                               macosx-all
+java/net/MulticastSocket/Test.java                              7145658 macosx-all
 
-# 7143960
-java/net/DatagramSocket/SendDatagramToBadAddress.java            macosx-all
+java/net/DatagramSocket/SendDatagramToBadAddress.java           7143960 macosx-all
 
 ############################################################################
 
 # jdk_nio
 
-# 6963118
-java/nio/channels/Selector/Wakeup.java                          windows-all
+java/nio/channels/Selector/Wakeup.java                          6963118 windows-all
 
-# 7141822
-java/nio/channels/DatagramChannel/ChangingAddress.java          macosx-all
+java/nio/channels/DatagramChannel/ChangingAddress.java          7141822 macosx-all
 
-# 7132677
-java/nio/channels/Selector/OutOfBand.java                       macosx-all
+java/nio/channels/Selector/OutOfBand.java                       7132677 macosx-all
 
-# 7158947, Solaris 11
-java/nio/file/WatchService/Basic.java				solaris-all
-java/nio/file/WatchService/MayFlies.java			solaris-all
-java/nio/file/WatchService/LotsOfEvents.java			solaris-all
+java/nio/file/WatchService/Basic.java                           7158947 solaris-all Solaris 11
+java/nio/file/WatchService/MayFlies.java                        7158947 solaris-all Solaris 11
+java/nio/file/WatchService/LotsOfEvents.java                    7158947 solaris-all Solaris 11
 
-# 8149712
-java/nio/charset/coders/BashStreams.java                        generic-all
+java/nio/charset/coders/BashStreams.java                        8149712 generic-all
 
 ############################################################################
 
 # jdk_rmi
 
-# 7140992
-java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java  generic-all
+java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java 7140992 generic-all
 
-# 7146541
-java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java	linux-all
+java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java 7146541 linux-all
 
-# 7191877
-java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java       generic-all
+java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java       7191877 generic-all
 
-# 7195095
-sun/rmi/transport/proxy/EagerHttpFallback.java                  generic-all
+sun/rmi/transport/proxy/EagerHttpFallback.java                  7195095 generic-all
 
-# 8062724
-java/rmi/activation/Activatable/extLoadedImpl/ext.sh            generic-all
+java/rmi/activation/Activatable/extLoadedImpl/ext.sh            8062724 generic-all
 
-# 8145980
-sun/rmi/rmic/newrmic/equivalence/run.sh                         generic-all
+sun/rmi/rmic/newrmic/equivalence/run.sh                         8145980 generic-all
 
 ############################################################################
 
 # jdk_security
 
-# 7157786
-sun/security/pkcs11/ec/TestKeyFactory.java                      generic-all
+sun/security/pkcs11/ec/TestKeyFactory.java                      7157786 generic-all
 
-# 7164518: no PortUnreachableException on Mac
-sun/security/krb5/auto/Unreachable.java                         macosx-all
+sun/security/krb5/auto/Unreachable.java                         7164518 macosx-all no PortUnreachableException on Mac
 
-# 7041639: Solaris DSA keypair generation bug
-java/security/KeyPairGenerator/SolarisShortDSA.java             solaris-all
-sun/security/tools/keytool/standard.sh                          solaris-all
+java/security/KeyPairGenerator/SolarisShortDSA.java             7041639 solaris-all
+sun/security/tools/keytool/standard.sh                          7041639 solaris-all
 
-# 8062758
-java/security/Security/ClassLoaderDeadlock/Deadlock2.sh         generic-all
+java/security/Security/ClassLoaderDeadlock/Deadlock2.sh         8062758 generic-all
 
-# 8026393
-sun/security/tools/jarsigner/warnings/BadKeyUsageTest.java      generic-all
+sun/security/tools/jarsigner/warnings/BadKeyUsageTest.java      8026393 generic-all
 
-# 8077138: Some PKCS11 tests fail because NSS library is not initialized
-# 8023434: NSS initialization failed
-sun/security/pkcs11/Cipher/ReinitCipher.java                    windows-all
-sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java           windows-all
-sun/security/pkcs11/Cipher/TestRSACipher.java                   windows-all
-sun/security/pkcs11/Cipher/TestRSACipherWrap.java               windows-all
-sun/security/pkcs11/Cipher/TestRawRSACipher.java                windows-all
-sun/security/pkcs11/Cipher/TestSymmCiphers.java                 windows-all
-sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java            windows-all
-sun/security/pkcs11/KeyAgreement/TestDH.java                    windows-all
-sun/security/pkcs11/KeyAgreement/TestInterop.java               windows-all
-sun/security/pkcs11/KeyAgreement/TestShort.java                 windows-all
-sun/security/pkcs11/KeyGenerator/DESParity.java                 windows-all
-sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java          windows-all
-sun/security/pkcs11/KeyPairGenerator/TestDH2048.java            windows-all
-sun/security/pkcs11/KeyStore/SecretKeysBasic.sh                 windows-all
-sun/security/pkcs11/Mac/MacKAT.java                             windows-all
-sun/security/pkcs11/Mac/MacSameTest.java                        windows-all
-sun/security/pkcs11/Mac/ReinitMac.java                          windows-all
-sun/security/pkcs11/MessageDigest/ByteBuffers.java              windows-all
-sun/security/pkcs11/MessageDigest/DigestKAT.java                windows-all
-sun/security/pkcs11/MessageDigest/ReinitDigest.java             windows-all
-sun/security/pkcs11/MessageDigest/TestCloning.java              windows-all
-sun/security/pkcs11/Provider/ConfigQuotedString.sh              windows-all
-sun/security/pkcs11/Provider/Login.sh                           windows-all
-sun/security/pkcs11/SampleTest.java                             windows-all
-sun/security/pkcs11/Secmod/AddPrivateKey.java                   windows-all
-sun/security/pkcs11/Secmod/AddTrustedCert.java                  windows-all
-sun/security/pkcs11/Secmod/Crypto.java                          windows-all
-sun/security/pkcs11/Secmod/GetPrivateKey.java                   windows-all
-sun/security/pkcs11/Secmod/JksSetPrivateKey.java                windows-all
-sun/security/pkcs11/Secmod/LoadKeystore.java                    windows-all
-sun/security/pkcs11/SecureRandom/Basic.java                     windows-all
-sun/security/pkcs11/SecureRandom/TestDeserialization.java       windows-all
-sun/security/pkcs11/Serialize/SerializeProvider.java            windows-all
-sun/security/pkcs11/Signature/ByteBuffers.java                  windows-all
-sun/security/pkcs11/Signature/ReinitSignature.java              windows-all
-sun/security/pkcs11/Signature/TestDSA.java                      windows-all
-sun/security/pkcs11/Signature/TestDSAKeyLength.java             windows-all
-sun/security/pkcs11/Signature/TestRSAKeyLength.java             windows-all
-sun/security/pkcs11/ec/ReadCertificates.java                    windows-all
-sun/security/pkcs11/ec/ReadPKCS12.java                          windows-all
-sun/security/pkcs11/ec/TestCurves.java                          windows-all
-sun/security/pkcs11/ec/TestECDH.java                            windows-all
-sun/security/pkcs11/ec/TestECDH2.java                           windows-all
-sun/security/pkcs11/ec/TestECDSA.java                           windows-all
-sun/security/pkcs11/ec/TestECDSA2.java                          windows-all
-sun/security/pkcs11/ec/TestECGenSpec.java                       windows-all
-sun/security/pkcs11/rsa/KeyWrap.java                            windows-all
-sun/security/pkcs11/rsa/TestCACerts.java                        windows-all
-sun/security/pkcs11/rsa/TestKeyFactory.java                     windows-all
-sun/security/pkcs11/rsa/TestKeyPairGenerator.java               windows-all
-sun/security/pkcs11/rsa/TestSignatures.java                     windows-all
-sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java            windows-all
-sun/security/pkcs11/tls/TestKeyMaterial.java                    windows-all
-sun/security/pkcs11/tls/TestLeadingZeroesP11.java               windows-all
-sun/security/pkcs11/tls/TestMasterSecret.java                   windows-all
-sun/security/pkcs11/tls/TestPRF.java                            windows-all
-sun/security/pkcs11/tls/TestPremaster.java                      windows-all
+sun/security/pkcs11/Cipher/ReinitCipher.java                    8077138,8023434 windows-all
+sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java           8077138,8023434 windows-all
+sun/security/pkcs11/Cipher/TestRSACipher.java                   8077138,8023434 windows-all
+sun/security/pkcs11/Cipher/TestRSACipherWrap.java               8077138,8023434 windows-all
+sun/security/pkcs11/Cipher/TestRawRSACipher.java                8077138,8023434 windows-all
+sun/security/pkcs11/Cipher/TestSymmCiphers.java                 8077138,8023434 windows-all
+sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java            8077138,8023434 windows-all
+sun/security/pkcs11/KeyAgreement/TestDH.java                    8077138,8023434 windows-all
+sun/security/pkcs11/KeyAgreement/TestInterop.java               8077138,8023434 windows-all
+sun/security/pkcs11/KeyAgreement/TestShort.java                 8077138,8023434 windows-all
+sun/security/pkcs11/KeyGenerator/DESParity.java                 8077138,8023434 windows-all
+sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java          8077138,8023434 windows-all
+sun/security/pkcs11/KeyPairGenerator/TestDH2048.java            8077138,8023434 windows-all
+sun/security/pkcs11/KeyStore/SecretKeysBasic.sh                 8077138,8023434 windows-all
+sun/security/pkcs11/Mac/MacKAT.java                             8077138,8023434 windows-all
+sun/security/pkcs11/Mac/MacSameTest.java                        8077138,8023434 windows-all
+sun/security/pkcs11/Mac/ReinitMac.java                          8077138,8023434 windows-all
+sun/security/pkcs11/MessageDigest/ByteBuffers.java              8077138,8023434 windows-all
+sun/security/pkcs11/MessageDigest/DigestKAT.java                8077138,8023434 windows-all
+sun/security/pkcs11/MessageDigest/ReinitDigest.java             8077138,8023434 windows-all
+sun/security/pkcs11/MessageDigest/TestCloning.java              8077138,8023434 windows-all
+sun/security/pkcs11/Provider/ConfigQuotedString.sh              8077138,8023434 windows-all
+sun/security/pkcs11/Provider/Login.sh                           8077138,8023434 windows-all
+sun/security/pkcs11/SampleTest.java                             8077138,8023434 windows-all
+sun/security/pkcs11/Secmod/AddPrivateKey.java                   8077138,8023434 windows-all
+sun/security/pkcs11/Secmod/AddTrustedCert.java                  8077138,8023434 windows-all
+sun/security/pkcs11/Secmod/Crypto.java                          8077138,8023434 windows-all
+sun/security/pkcs11/Secmod/GetPrivateKey.java                   8077138,8023434 windows-all
+sun/security/pkcs11/Secmod/JksSetPrivateKey.java                8077138,8023434 windows-all
+sun/security/pkcs11/Secmod/LoadKeystore.java                    8077138,8023434 windows-all
+sun/security/pkcs11/SecureRandom/Basic.java                     8077138,8023434 windows-all
+sun/security/pkcs11/SecureRandom/TestDeserialization.java       8077138,8023434 windows-all
+sun/security/pkcs11/Serialize/SerializeProvider.java            8077138,8023434 windows-all
+sun/security/pkcs11/Signature/ByteBuffers.java                  8077138,8023434 windows-all
+sun/security/pkcs11/Signature/ReinitSignature.java              8077138,8023434 windows-all
+sun/security/pkcs11/Signature/TestDSA.java                      8077138,8023434 windows-all
+sun/security/pkcs11/Signature/TestDSAKeyLength.java             8077138,8023434 windows-all
+sun/security/pkcs11/Signature/TestRSAKeyLength.java             8077138,8023434 windows-all
+sun/security/pkcs11/ec/ReadCertificates.java                    8077138,8023434 windows-all
+sun/security/pkcs11/ec/ReadPKCS12.java                          8077138,8023434 windows-all
+sun/security/pkcs11/ec/TestCurves.java                          8077138,8023434 windows-all
+sun/security/pkcs11/ec/TestECDH.java                            8077138,8023434 windows-all
+sun/security/pkcs11/ec/TestECDH2.java                           8077138,8023434 windows-all
+sun/security/pkcs11/ec/TestECDSA.java                           8077138,8023434 windows-all
+sun/security/pkcs11/ec/TestECDSA2.java                          8077138,8023434 windows-all
+sun/security/pkcs11/ec/TestECGenSpec.java                       8077138,8023434 windows-all
+sun/security/pkcs11/rsa/KeyWrap.java                            8077138,8023434 windows-all
+sun/security/pkcs11/rsa/TestCACerts.java                        8077138,8023434 windows-all
+sun/security/pkcs11/rsa/TestKeyFactory.java                     8077138,8023434 windows-all
+sun/security/pkcs11/rsa/TestKeyPairGenerator.java               8077138,8023434 windows-all
+sun/security/pkcs11/rsa/TestSignatures.java                     8077138,8023434 windows-all
+sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java            8077138,8023434 windows-all
+sun/security/pkcs11/tls/TestKeyMaterial.java                    8077138,8023434 windows-all
+sun/security/pkcs11/tls/TestLeadingZeroesP11.java               8077138,8023434 windows-all
+sun/security/pkcs11/tls/TestMasterSecret.java                   8077138,8023434 windows-all
+sun/security/pkcs11/tls/TestPRF.java                            8077138,8023434 windows-all
+sun/security/pkcs11/tls/TestPremaster.java                      8077138,8023434 windows-all
 
-# 8051770
-sun/security/provider/SecureRandom/StrongSecureRandom.java      macosx-10.10
+sun/security/provider/SecureRandom/StrongSecureRandom.java      8051770 macosx-10.10
 
-# 8074580
-sun/security/pkcs11/rsa/TestKeyPairGenerator.java               generic-all
+sun/security/pkcs11/rsa/TestKeyPairGenerator.java               8074580 generic-all
 
-# 8038079
-sun/security/krb5/auto/HttpNegotiateServer.java                 generic-all
+sun/security/krb5/auto/HttpNegotiateServer.java                 8038079 generic-all
 
-# 8130302
-sun/security/tools/keytool/autotest.sh                          generic-all
+sun/security/tools/keytool/autotest.sh                          8130302 generic-all
 
 ############################################################################
 
 # jdk_sound
 
-# 8059743
-javax/sound/midi/Gervill/SoftProvider/GetDevice.java            generic-all
+javax/sound/midi/Gervill/SoftProvider/GetDevice.java            8059743 generic-all
 
 ############################################################################
 
 # jdk_imageio
-javax/imageio/plugins/shared/CanWriteSequence.java              generic-all
-javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java     generic-all
-javax/imageio/plugins/tiff/WriteToSequenceAfterAbort.java       generic-all
+javax/imageio/plugins/shared/CanWriteSequence.java              8148454 generic-all
+javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java     8148454 generic-all
+javax/imageio/plugins/tiff/WriteToSequenceAfterAbort.java       8148454 generic-all
 
 ############################################################################
 
@@ -348,56 +311,41 @@
 
 # jdk_tools
 
-# Tests take too long, on sparcs see 7143279
-# also see 8059906
-tools/pack200/CommandLineTests.java                             generic-all
+tools/pack200/CommandLineTests.java                             7143279,8059906 generic-all
 
-# 8059906 fails on solaris and macosx, 8151901 
-tools/pack200/Pack200Test.java                                  generic-all
+tools/pack200/Pack200Test.java                                  8059906,8151901 generic-all
 
-# 8152622
-tools/pack200/Pack200Props.java                                 macosx-all
+tools/pack200/Pack200Props.java                                 8152622 macosx-all
 
-# 8068049 
-tools/launcher/FXLauncherTest.java                              linux-all,macosx-all
+tools/launcher/FXLauncherTest.java                              8068049 linux-all,macosx-all
 
 ############################################################################
 
 # jdk_jdi
 
-# 8004127
-com/sun/jdi/RedefineImplementor.sh                              generic-all
+com/sun/jdi/RedefineImplementor.sh                              8004127 generic-all
 
-# 8031555
-com/sun/jdi/JdbMethodExitTest.sh                                generic-all
+com/sun/jdi/JdbMethodExitTest.sh                                8031555 generic-all
 
-# 8043571
-com/sun/jdi/RepStep.java                                        generic-all
+com/sun/jdi/RepStep.java                                        8043571 generic-all
 
-# 8058616
-com/sun/jdi/RedefinePop.sh                                      generic-all
+com/sun/jdi/RedefinePop.sh                                      8058616 generic-all
 
-# 8068645
-com/sun/jdi/CatchPatternTest.sh                                 generic-all
+com/sun/jdi/CatchPatternTest.sh                                 8068645 generic-all
 
-# 8067354
-com/sun/jdi/GetLocalVariables4Test.sh				windows-all
+com/sun/jdi/GetLocalVariables4Test.sh                           8067354 windows-all
 
 ############################################################################
 
 # jdk_util
 
-# 8062512
-java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.java generic-all
+java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.java 8062512 generic-all
 
-# 8130337
-java/util/stream/test/org/openjdk/tests/java/util/stream/IntPrimitiveOpsTests.java generic-all
+java/util/stream/test/org/openjdk/tests/java/util/stream/IntPrimitiveOpsTests.java 8130337 generic-all
 
-# 8080165, 8085982
-java/util/Arrays/ParallelPrefix.java generic-all
+java/util/Arrays/ParallelPrefix.java                            8080165,8085982 generic-all
 
-# 8079538
-java/util/BitSet/BitSetStreamTest.java generic-all
+java/util/BitSet/BitSetStreamTest.java                          8079538 generic-all
 
 ############################################################################
 
@@ -407,43 +355,33 @@
 
 # svc_tools
 
-# 8031482
-sun/tools/jcmd/TestJcmdSanity.java				windows-all
+sun/tools/jcmd/TestJcmdSanity.java                              8031482 windows-all
 
-# 8072131, 8132452
-sun/tools/jmap/heapconfig/JMapHeapConfigTest.java generic-all
+sun/tools/jmap/heapconfig/JMapHeapConfigTest.java               8072131,8132452 generic-all
 
-# 8046285
-sun/tools/jstatd/TestJstatdExternalRegistry.java                generic-all
+sun/tools/jstatd/TestJstatdExternalRegistry.java                8046285 generic-all
 
-# 6456333
-sun/tools/jps/TestJpsJarRelative.java				generic-all
+sun/tools/jps/TestJpsJarRelative.java                           6456333 generic-all
 
-# 6734748
-sun/tools/jinfo/JInfoRunningProcessFlagTest.java		generic-all
+sun/tools/jinfo/JInfoRunningProcessFlagTest.java                6734748 generic-all
 
-# 8057732
-sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java    generic-all
+sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java    8057732 generic-all
 
-# 8059035
-sun/tools/jinfo/JInfoSanityTest.java                           generic-all
+sun/tools/jinfo/JInfoSanityTest.java                            8059035 generic-all
 
-# 8151899
-demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java       generic-all
+demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java       8151899 generic-all
 
 ############################################################################
 
 # jdk_other
 
-# 8141370
-com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java			linux-i586,macosx-all
+com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java                   8141370 linux-i586,macosx-all
 
 ############################################################################
 
 # core_tools
 
-# 8150975
-# tools/jimage/JImageTest.java                                    linux-i586,windows-i586
+tools/jimage/JImageTest.java                                    8150975 linux-i586,windows-i586
 
 ############################################################################
 
--- a/test/TEST.groups	Thu Mar 31 01:13:26 2016 -0700
+++ b/test/TEST.groups	Thu Mar 31 09:00:24 2016 -0700
@@ -60,7 +60,8 @@
     :jdk_rmi \
     :jdk_beans \
     :jdk_imageio \
-    :jdk_sound
+    :jdk_sound \
+    :jdk_client_sanity
 
 ###############################################################################
 #
@@ -351,6 +352,10 @@
     :jdk_sound \
     :jdk_imageio
 
+# SwingSet3 tests.
+jdk_client_sanity = \
+    sanity/client/SwingSet
+    
 ###############################################################################
 #
 # Serviceability sanity groups
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/Calendar/Bug8152077.java	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8152077
+ * @summary Make sure that roll() with HOUR/HOUR_OF_DAY works around standard/daylight
+ *          time transitions
+ */
+
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+import static java.util.Calendar.*;
+
+public class Bug8152077 {
+    private static final TimeZone LA = TimeZone.getTimeZone("America/Los_Angeles");
+    private static final TimeZone BR = TimeZone.getTimeZone("America/Sao_Paulo");
+
+    private static final int[] ALLDAY_HOURS = {
+        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+        12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
+    };
+    private static final int[] AM_HOURS = {
+        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
+    };
+    private static final int[] PM_HOURS = { // in 24-hour clock
+        12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
+    };
+
+    private static int errors;
+
+    public static void main(String[] args) {
+        TimeZone initialTz = TimeZone.getDefault();
+        try {
+            testRoll(LA, new int[] { 2016, MARCH, 13 },
+                     new int[] { 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+                         12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 });
+            testRoll(LA, new int[] { 2016, MARCH, 13 },
+                     new int[] { 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11 });
+            testRoll(LA, new int[] { 2016, MARCH, 13 }, PM_HOURS);
+
+            testRoll(LA, new int[] { 2016, NOVEMBER, 6 }, ALLDAY_HOURS);
+            testRoll(LA, new int[] { 2016, NOVEMBER, 6 }, AM_HOURS);
+            testRoll(LA, new int[] { 2016, NOVEMBER, 6 }, PM_HOURS);
+
+            testRoll(BR, new int[] { 2016, FEBRUARY, 21 }, ALLDAY_HOURS);
+            testRoll(BR, new int[] { 2016, FEBRUARY, 21 }, AM_HOURS);
+            testRoll(BR, new int[] { 2016, FEBRUARY, 21 }, PM_HOURS);
+
+            testRoll(BR, new int[] { 2016, OCTOBER, 15 }, ALLDAY_HOURS);
+            testRoll(BR, new int[] { 2016, OCTOBER, 15 }, PM_HOURS);
+            testRoll(BR, new int[] { 2016, OCTOBER, 16 },
+                     new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+                         12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 });
+            testRoll(BR, new int[] { 2016, OCTOBER, 16 },
+                     new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 });
+            testRoll(BR, new int[] { 2016, OCTOBER, 16 }, PM_HOURS);
+        } finally {
+            TimeZone.setDefault(initialTz);
+        }
+        if (errors > 0) {
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    private static void testRoll(TimeZone tz, int[] params, int[] sequence) {
+        TimeZone.setDefault(tz);
+        for (int i = 0; i < sequence.length; i++) {
+            testRoll(+1, params, sequence, i);
+            testRoll(-1, params, sequence, i);
+        }
+    }
+
+    // amount must be 1 or -1.
+    private static void testRoll(int amount, int[] params, int[] sequence, int startIndex) {
+        int year = params[0];
+        int month = params[1];
+        int dayOfMonth = params[2];
+        int hourOfDay = sequence[startIndex];
+        Calendar cal = new GregorianCalendar(year, month, dayOfMonth,
+                                             hourOfDay, 0, 0);
+        int ampm = cal.get(AM_PM);
+
+        int length = sequence.length;
+        int count = length * 2;
+        int field = (length > 12) ? HOUR_OF_DAY : HOUR;
+
+        System.out.printf("roll(%s, %2d) starting from %s%n",
+                          (field == HOUR) ? "HOUR" : "HOUR_OF_DAY", amount, cal.getTime());
+        for (int i = 0; i < count; i++) {
+            int index = (amount > 0) ? (startIndex + i + 1) % length
+                                     : Math.floorMod(startIndex - i - 1, length);
+            int expected = sequence[index];
+            if (field == HOUR) {
+                expected %= 12;
+            }
+            cal.roll(field, amount);
+            int value = cal.get(field);
+            if (value != expected) {
+                System.out.println("Unexpected field value: got=" + value
+                                    + ", expected=" + expected);
+                errors++;
+            }
+            if (cal.get(DAY_OF_MONTH) != dayOfMonth) {
+                System.out.println("DAY_OF_MONTH changed: " + dayOfMonth
+                                    + " to " + cal.get(DAY_OF_MONTH));
+            }
+            if (field == HOUR && cal.get(AM_PM) != ampm) {
+                System.out.println("AM_PM changed: " + ampm + " to " + cal.get(AM_PM));
+                errors++;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/List/NestedSubList.java	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8079136
+ * @run testng NestedSubList
+ * @summary Accessing a nested sublist leads to StackOverflowError
+ */
+
+import java.util.AbstractList;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Vector;
+
+import org.testng.annotations.Test;
+import org.testng.annotations.DataProvider;
+import static org.testng.Assert.fail;
+
+public class NestedSubList {
+
+    static final int NEST_LIMIT = 65536;
+
+    @Test(dataProvider="lists")
+    public void testAccessToSublists(List<Integer> list, boolean modifiable) {
+        Class<?> cls = list.getClass();
+        for (int i = 0; i < NEST_LIMIT; ++i) {
+            list = list.subList(0, 1);
+        }
+
+        try {
+            list.get(0);
+            if (modifiable) {
+                list.remove(0);
+                list.add(0, 42);
+            }
+        } catch (StackOverflowError e) {
+            fail("failed for " + cls);
+        }
+    }
+
+    @DataProvider
+    public static Object[][] lists() {
+        final boolean MODIFIABLE = true;
+        final boolean NON_MODIFIABLE = false;
+        List<Integer> c = Arrays.asList(42);
+
+        return new Object[][] {
+            {c, NON_MODIFIABLE},
+            {new ArrayList<>(c), MODIFIABLE},
+            {new LinkedList<>(c), MODIFIABLE},
+            {new MyList(), NON_MODIFIABLE},
+            {new Vector<>(c), MODIFIABLE},
+            {Collections.singletonList(42), NON_MODIFIABLE},
+            {Collections.checkedList(c, Integer.class), NON_MODIFIABLE},
+            {Collections.checkedList(new ArrayList<>(c), Integer.class), MODIFIABLE},
+            {Collections.checkedList(new LinkedList<>(c), Integer.class), MODIFIABLE},
+            {Collections.checkedList(new Vector<>(c), Integer.class), MODIFIABLE},
+            {Collections.synchronizedList(c), NON_MODIFIABLE},
+            {Collections.synchronizedList(new ArrayList<>(c)), MODIFIABLE},
+            {Collections.synchronizedList(new LinkedList<>(c)), MODIFIABLE},
+            {Collections.synchronizedList(new Vector<>(c)), MODIFIABLE},
+            {Collections.unmodifiableList(c), NON_MODIFIABLE},
+            {Collections.unmodifiableList(new ArrayList<>(c)), NON_MODIFIABLE},
+            {Collections.unmodifiableList(new LinkedList<>(c)), NON_MODIFIABLE},
+            {Collections.unmodifiableList(new Vector<>(c)), NON_MODIFIABLE},
+        };
+    }
+
+    static class MyList extends AbstractList<Integer> {
+        public Integer get(int index) { return 42; }
+        public int size() { return 1; }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/List/SubList.java	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,676 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8079136
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.*
+ * @run testng SubList
+ * @summary Basic functionality of sublists
+ * @key randomness
+ */
+
+import java.util.AbstractList;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.ConcurrentModificationException;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Random;
+import java.util.Vector;
+
+import org.testng.annotations.Test;
+import org.testng.annotations.DataProvider;
+
+import jdk.testlibrary.RandomFactory;
+
+
+public class SubList extends org.testng.Assert {
+
+    final Random rnd = RandomFactory.getRandom();
+
+    @Test(dataProvider = "modifiable")
+    public void testAdd(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        Integer e = rnd.nextInt();
+        subList.add(e);
+        assertEquals(list.get(to), e);
+        assertEquals(subList.size(), to - from + 1);
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModAdd(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        list.add(42);
+        subList.add(42);
+    }
+
+    @Test(dataProvider = "unresizable",
+          expectedExceptions = UnsupportedOperationException.class)
+    public void testUnmodAdd(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        subList.add(42);
+    }
+
+    @Test(dataProvider = "modifiable")
+    public void testAddAtPos(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        int i = rnd.nextInt(1 + to - from);
+        Integer e = rnd.nextInt();
+        subList.add(i, e);
+        assertEquals(list.get(from + i), e);
+        assertEquals(subList.size(), to - from + 1);
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModAddAtPos(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        list.add(42);
+        int i = rnd.nextInt(1 + to - from);
+        subList.add(i, 42);
+    }
+
+    @Test(dataProvider = "unresizable",
+          expectedExceptions = UnsupportedOperationException.class)
+    public void testUnmodAddAtPos(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        int i = rnd.nextInt(1 + to - from);
+        subList.add(i, 42);
+    }
+
+    @Test(dataProvider = "modifiable")
+    public void testClear(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        subList.clear();
+        assertTrue(subList.isEmpty());
+        assertEquals(subList.size(), 0);
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModClear(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        list.add(42);
+        subList.clear();
+    }
+
+    @Test(dataProvider = "unresizable",
+          expectedExceptions = UnsupportedOperationException.class)
+    public void testUnmodClear(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        subList.clear();
+    }
+
+    @Test(dataProvider = "all")
+    public void testEquals(List<Integer> list, int from, int to) {
+        List<Integer> subList1 = list.subList(from, to);
+        List<Integer> subList2 = list.subList(from, to);
+        assertTrue(subList1.equals(subList2));
+        assertEquals(subList1.hashCode(), subList2.hashCode());
+        for (int i = 0; i != 16; ++i) {
+            int from3 = rnd.nextInt(1 + list.size());
+            int to3 = from3 + rnd.nextInt(1 + list.size() - from3);
+            boolean equal = (to - from) == (to3 - from3);
+            for (int j = 0; j < to - from && j < to3 - from3; ++j)
+                equal &= list.get(from + j) == list.get(from3 + j);
+            List<Integer> subList3 = list.subList(from3, to3);
+            assertEquals(subList1.equals(subList3), equal);
+        }
+    }
+
+//    @Test(dataProvider = "modifiable",
+//          expectedExceptions = ConcurrentModificationException.class)
+//    public void testModEquals(List<Integer> list, int from, int to) {
+//        List<Integer> subList = list.subList(from, to);
+//        list.add(42);
+//        subList.equals(subList);
+//    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModHashCode(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        list.add(42);
+        subList.hashCode();
+    }
+
+    @Test(dataProvider = "all")
+    public void testGet(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        for (int i = 0; i < to - from; ++i)
+            assertEquals(list.get(from + i), subList.get(i));
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModGet(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        list.add(42);
+        subList.get(from);
+    }
+
+    @Test(dataProvider = "all")
+    public void testIndexOf(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        if (from < to) {
+            Integer e = list.get(from);
+            int j = subList.indexOf(e);
+            assertTrue(j == 0);
+        }
+        for (int i = 0; i < list.size(); ++i) {
+            Integer e = list.get(i);
+            int j = subList.indexOf(e);
+            if (i < from || i >= to) {
+                assertTrue(j == -1 || subList.get(j) == e);
+            } else {
+                assertTrue(j >= 0);
+                assertTrue(j <= i - from);
+                assertEquals(subList.get(j), e);
+            }
+        }
+        for (int i = 0; i < 16; ++i) {
+            Integer r = rnd.nextInt();
+            if (list.contains(r)) continue;
+            int j = subList.indexOf(r);
+            assertTrue(j == -1);
+        }
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModIndexOf(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        list.add(42);
+        subList.indexOf(from);
+    }
+
+    @Test(dataProvider = "all")
+    public void testIterator(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        Iterator<Integer> it = subList.iterator();
+        for (int i = from; i < to; ++i) {
+            assertTrue(it.hasNext());
+            assertEquals(list.get(i), it.next());
+        }
+        assertFalse(it.hasNext());
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModIteratorNext(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        Iterator<Integer> it = subList.iterator();
+        list.add(42);
+        it.next();
+    }
+
+    @Test(dataProvider = "modifiable")
+    public void testIteratorRemove(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        Iterator<Integer> it = subList.iterator();
+        for (int i = from; i < to; ++i) {
+            assertTrue(it.hasNext());
+            assertEquals(list.get(from), it.next());
+            it.remove();
+        }
+        assertFalse(it.hasNext());
+        assertTrue(subList.isEmpty());
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModIteratorRemove(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        Iterator<Integer> it = subList.iterator();
+        it.next();
+        list.add(42);
+        it.remove();
+    }
+
+    @Test(dataProvider = "unresizable",
+          expectedExceptions = UnsupportedOperationException.class)
+    public void testUnmodIteratorRemove(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        Iterator<Integer> it = subList.iterator();
+        it.next();
+        it.remove();
+    }
+
+    @Test(dataProvider = "all")
+    public void testIteratorForEachRemaining(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        for (int k = 0; k < 16; ++k) {
+            int r = from + rnd.nextInt(1 + to - from);
+            Iterator<Integer> it = subList.iterator();
+            for (int i = from; i < to; ++i) {
+                assertTrue(it.hasNext());
+                if (i == r) {
+                    Iterator<Integer> jt = list.listIterator(r);
+                    it.forEachRemaining(x ->
+                        assertTrue(jt.hasNext() && x == jt.next()));
+                    break;
+                }
+                assertEquals(list.get(i), it.next());
+            }
+            it.forEachRemaining(x -> fail());
+        }
+    }
+
+    @Test(dataProvider = "all")
+    public void testLastIndexOf(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        if (from < to) {
+            Integer e = list.get(to - 1);
+            int j = subList.lastIndexOf(e);
+            assertTrue(j == to - from - 1);
+        }
+        for (int i = 0; i < list.size(); ++i) {
+            Integer e = list.get(i);
+            int j = subList.lastIndexOf(e);
+            if (i < from || i >= to) {
+                assertTrue(j == -1 || subList.get(j) == e);
+            } else {
+                assertTrue(j >= 0 && j >= i - from);
+                assertEquals(subList.get(j), e);
+            }
+        }
+        for (int i = 0; i < 16; ++i) {
+            Integer r = rnd.nextInt();
+            if (list.contains(r)) continue;
+            int j = subList.lastIndexOf(r);
+            assertTrue(j == -1);
+        }
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModLastIndexOf(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        list.add(42);
+        subList.lastIndexOf(42);
+    }
+
+    @Test(dataProvider = "unresizable")
+    public void testListIterator(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator();
+        for (int i = from; i < to; ++i) {
+            assertTrue(it.hasNext());
+            assertTrue(it.nextIndex() == i - from);
+            assertEquals(list.get(i), it.next());
+        }
+        assertFalse(it.hasNext());
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModListIteratorNext(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator();
+        list.add(42);
+        it.next();
+    }
+
+    @Test(dataProvider = "modifiable")
+    public void testListIteratorSet(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator();
+        for (int i = from; i < to; ++i) {
+            assertTrue(it.hasNext());
+            assertTrue(it.nextIndex() == i - from);
+            assertEquals(list.get(i), it.next());
+            Integer e = rnd.nextInt();
+            it.set(e);
+            assertEquals(list.get(i), e);
+        }
+        assertFalse(it.hasNext());
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModListIteratorSet(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator();
+        it.next();
+        list.add(42);
+        it.set(42);
+    }
+
+    @Test(dataProvider = "unsettable",
+          expectedExceptions = UnsupportedOperationException.class)
+    public void testUnmodListIteratorSet(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator();
+        it.next();
+        it.set(42);
+    }
+
+    @Test(dataProvider = "unresizable")
+    public void testListIteratorPrevious(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator(subList.size());
+        for (int i = to - 1; i >= from; --i) {
+            assertTrue(it.hasPrevious());
+            assertTrue(it.previousIndex() == i - from);
+            assertEquals(list.get(i), it.previous());
+        }
+        assertFalse(it.hasPrevious());
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModListIteratorPrevious(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator(to - from);
+        list.add(42);
+        it.previous();
+    }
+
+    @Test(dataProvider = "modifiable")
+    public void testListIteratorSetPrevious(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator(subList.size());
+        for (int i = to - 1; i >= from; --i) {
+            assertTrue(it.hasPrevious());
+            assertTrue(it.previousIndex() == i - from);
+            assertEquals(list.get(i), it.previous());
+            Integer e = rnd.nextInt();
+            it.set(e);
+            assertEquals(list.get(i), e);
+        }
+        assertFalse(it.hasPrevious());
+    }
+
+    @Test(dataProvider = "unsettable",
+          expectedExceptions = UnsupportedOperationException.class)
+    public void testUnmodListIteratorSetPrevious(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator(to - from);
+        it.previous();
+        it.set(42);
+    }
+
+    @Test(dataProvider = "modifiable")
+    public void testListIteratorAdd(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        for (int i = 0; i < 16; ++i) {
+            int r = rnd.nextInt(1 + subList.size());
+            ListIterator<Integer> it = subList.listIterator(r);
+            Integer e = rnd.nextInt();
+            it.add(e);
+            assertEquals(it.previous(), e);
+            assertEquals(list.get(from + r), e);
+        }
+    }
+
+    @Test(dataProvider = "unresizable",
+          expectedExceptions = UnsupportedOperationException.class)
+    public void testUnmodListIteratorAdd(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        int r = rnd.nextInt(1 + subList.size());
+        ListIterator<Integer> it = subList.listIterator(r);
+        it.add(42);
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModListIteratorAdd(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator();
+        it.next();
+        list.add(42);
+        it.add(42);
+    }
+
+    @Test(dataProvider = "modifiable")
+    public void testListIteratorRemoveNext(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator();
+        for (int i = from; i < to; ++i) {
+            assertTrue(it.hasNext());
+            assertTrue(it.nextIndex() == 0);
+            assertEquals(list.get(from), it.next());
+            it.remove();
+        }
+        assertFalse(it.hasNext());
+        assertTrue(subList.isEmpty());
+    }
+
+    @Test(dataProvider = "unresizable",
+          expectedExceptions = UnsupportedOperationException.class)
+    public void testUnmodListIteratorRemoveNext(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator();
+        it.next();
+        it.remove();
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModListIteratorRemove(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator();
+        it.next();
+        list.add(42);
+        it.remove();
+    }
+
+    @Test(dataProvider = "modifiable")
+    public void testListIteratorRemovePrevious(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator(subList.size());
+        for (int i = to - 1; i >= from; --i) {
+            assertTrue(it.hasPrevious());
+            assertTrue(it.previousIndex() == i - from);
+            assertEquals(list.get(i), it.previous());
+            it.remove();
+        }
+        assertFalse(it.hasPrevious());
+        assertTrue(subList.isEmpty());
+    }
+
+    @Test(dataProvider = "unresizable",
+          expectedExceptions = UnsupportedOperationException.class)
+    public void testUnmodListIteratorRemovePrevious(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        ListIterator<Integer> it = subList.listIterator(subList.size());
+        it.previous();
+        it.remove();
+    }
+
+    @Test(dataProvider = "modifiable")
+    public void testRemove(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        for (int i = 0; i < 16; ++i) {
+            if (subList.isEmpty()) break;
+            int r = rnd.nextInt(subList.size());
+            Integer e = list.get(from + r);
+            assertEquals(subList.remove(r), e);
+        }
+    }
+
+    @Test(dataProvider = "unresizable",
+          expectedExceptions = UnsupportedOperationException.class)
+    public void testUnmodRemove(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        int r = rnd.nextInt(subList.size());
+        subList.remove(r);
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModRemove(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        list.add(42);
+        subList.remove(0);
+    }
+
+    @Test(dataProvider = "modifiable")
+    public void testSet(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        for (int i = 0; i < to - from; ++i) {
+            Integer e0 = list.get(from + i);
+            Integer e1 = rnd.nextInt();
+            assertEquals(subList.set(i, e1), e0);
+            assertEquals(list.get(from + i), e1);
+        }
+    }
+
+    @Test(dataProvider = "modifiable",
+          expectedExceptions = ConcurrentModificationException.class)
+    public void testModSet(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        list.add(42);
+        subList.set(0, 42);
+    }
+
+    @Test(dataProvider = "all")
+    public void testSubList(List<Integer> list, int from, int to) {
+        List<Integer> subList = list.subList(from, to);
+        for (int i = 0; i < 16 && from < to; ++i) {
+            int from1 = rnd.nextInt(to - from);
+            int to1 = from1 + 1 + rnd.nextInt(to - from - from1);
+            List<Integer> subSubList = subList.subList(from1, to1);
+            for (int j = 0; j < to1 - from1; ++j)
+                assertEquals(list.get(from + from1 + j), subSubList.get(j));
+        }
+    }
+
+    /**
+     * All kinds of lists
+     */
+    @DataProvider
+    public static Object[][] all() {
+        Object[][] l1 = modifiable();
+        Object[][] l2 = unresizable();
+        Object[][] res = Arrays.copyOf(l1, l1.length + l2.length);
+        System.arraycopy(l2, 0, res, l1.length, l2.length);
+        return res;
+    }
+
+    /**
+     * Lists that allow any modifications: resizing and setting values
+     */
+    @DataProvider
+    public static Object[][] modifiable() {
+        final List<Integer> c1 = Arrays.asList(42);
+        final List<Integer> c9 = Arrays.asList(40, 41, 42, 43, 44, 45, -1,
+                Integer.MIN_VALUE, 1000500);
+
+        return new Object[][] {
+            {new ArrayList<>(c1), 0, 1},
+            {new LinkedList<>(c1), 0, 1},
+            {new Vector<>(c1), 0, 1},
+            {new ArrayList<>(c1).subList(0, 1), 0, 1},
+            {new LinkedList<>(c1).subList(0, 1), 0, 1},
+            {new Vector<>(c1).subList(0, 1), 0, 1},
+            {Collections.checkedList(new ArrayList<>(c1), Integer.class), 0, 1},
+            {Collections.checkedList(new LinkedList<>(c1), Integer.class), 0, 1},
+            {Collections.checkedList(new Vector<>(c1), Integer.class), 0, 1},
+            {Collections.synchronizedList(new ArrayList<>(c1)), 0, 1},
+            {Collections.synchronizedList(new LinkedList<>(c1)), 0, 1},
+            {Collections.synchronizedList(new Vector<>(c1)), 0, 1},
+
+            {new ArrayList<>(c9), 2, 5},
+            {new LinkedList<>(c9), 2, 5},
+            {new Vector<>(c9), 2, 5},
+            {new ArrayList<>(c9).subList(1, 8), 1, 4},
+            {new LinkedList<>(c9).subList(1, 8), 1, 4},
+            {new Vector<>(c9).subList(1, 8), 1, 4},
+            {Collections.checkedList(new ArrayList<>(c9), Integer.class), 2, 5},
+            {Collections.checkedList(new LinkedList<>(c9), Integer.class), 2, 5},
+            {Collections.checkedList(new Vector<>(c9), Integer.class), 2, 5},
+            {Collections.synchronizedList(new ArrayList<>(c9)), 2, 5},
+            {Collections.synchronizedList(new LinkedList<>(c9)), 2, 5},
+            {Collections.synchronizedList(new Vector<>(c9)), 2, 5},
+        };
+    }
+
+    /**
+     * Lists that don't allow resizing, but allow setting values
+     */
+    @DataProvider
+    public static Object[][] unresizable() {
+        final List<Integer> c1 = Arrays.asList(42);
+        final List<Integer> c9 = Arrays.asList(40, 41, 42, 43, 44, 45, -1,
+                Integer.MIN_VALUE, 1000500);
+
+        Object[][] l1 = unsettable();
+        Object[][] l2 = {
+            {c1, 0, 1},
+            {c1.subList(0, 1), 0, 1},
+            {Collections.checkedList(c1, Integer.class), 0, 1},
+            {Collections.synchronizedList(c1), 0, 1},
+            {c9, 0, 4},
+            {c9, 4, 6},
+            {c9.subList(1, 8), 1, 4},
+            {c9.subList(1, 8), 0, 7},
+            {Collections.checkedList(c9, Integer.class), 3, 6},
+            {Collections.synchronizedList(c9), 3, 5},
+        };
+        Object[][] res = Arrays.copyOf(l1, l1.length + l2.length);
+        System.arraycopy(l2, 0, res, l1.length, l2.length);
+        return res;
+    }
+
+    /**
+     * Lists that don't allow either resizing or setting values
+     */
+    @DataProvider
+    public static Object[][] unsettable() {
+        final List<Integer> c1 = Arrays.asList(42);
+        final List<Integer> c9 = Arrays.asList(40, 41, 42, 43, 44, 45, -1,
+                Integer.MIN_VALUE, 1000500);
+
+        return new Object[][] {
+            {new MyList(1), 0, 1},
+            {new MyList(1).subList(0, 1), 0, 1},
+            {Collections.singletonList(42), 0, 1},
+            {Collections.singletonList(42).subList(0, 1), 0, 1},
+            {Collections.unmodifiableList(c1), 0, 1},
+            {Collections.unmodifiableList(new ArrayList<>(c1)), 0, 1},
+            {Collections.unmodifiableList(new LinkedList<>(c1)), 0, 1},
+            {Collections.unmodifiableList(new Vector<>(c1)), 0, 1},
+
+            {new MyList(9), 3, 6},
+            {new MyList(9).subList(2, 8), 3, 6},
+            {Collections.unmodifiableList(c9), 3, 6},
+            {Collections.unmodifiableList(new ArrayList<>(c9)), 3, 6},
+            {Collections.unmodifiableList(new LinkedList<>(c9)), 3, 6},
+            {Collections.unmodifiableList(new Vector<>(c9)), 3, 6},
+        };
+    }
+
+    static class MyList extends AbstractList<Integer> {
+        private int size;
+        MyList(int s) { size = s; }
+        public Integer get(int index) { return 42; }
+        public int size() { return size; }
+    }
+}
--- a/test/java/util/Locale/LocaleProviders.sh	Thu Mar 31 01:13:26 2016 -0700
+++ b/test/java/util/Locale/LocaleProviders.sh	Thu Mar 31 09:00:24 2016 -0700
@@ -25,6 +25,7 @@
 # @test
 # @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8008577
 #      8010666 8013086 8013233 8013903 8015960 8028771 8054482 8062006
+#      8150432
 # @summary tests for "java.locale.providers" system property
 # @modules java.base/sun.util.locale
 #          java.base/sun.util.locale.provider
@@ -168,7 +169,7 @@
       PARAM1=HOST
     fi
     ;;
-  CYGWIN_NT-6* | Darwin )
+  CYGWIN_NT-6* | CYGWIN_NT-10* | Darwin )
     PARAM1=HOST
     ;;
   * )
--- a/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java	Thu Mar 31 09:00:24 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -154,8 +154,8 @@
         }
 
         void addList(Function<Collection<T>, ? extends List<T>> l) {
-            // @@@ If collection is instance of List then add sub-list tests
             addCollection(l);
+            addCollection(l.andThen(list -> list.subList(0, list.size())));
         }
 
         void addMap(Function<Map<T, T>, ? extends Map<T, T>> m) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/concurrent/tck/TimeUnit8Test.java	Thu Mar 31 09:00:24 2016 -0700
@@ -0,0 +1,103 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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:
+ *
+ * Written by Doug Lea and Martin Buchholz with assistance from
+ * members of JCP JSR-166 Expert Group and released to the public
+ * domain, as explained at
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+import static java.util.concurrent.TimeUnit.DAYS;
+import static java.util.concurrent.TimeUnit.HOURS;
+import static java.util.concurrent.TimeUnit.MICROSECONDS;
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static java.util.concurrent.TimeUnit.MINUTES;
+import static java.util.concurrent.TimeUnit.NANOSECONDS;
+import static java.util.concurrent.TimeUnit.SECONDS;
+
+import java.time.temporal.ChronoUnit;
+import java.util.concurrent.TimeUnit;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class TimeUnit8Test extends JSR166TestCase {
+    public static void main(String[] args) {
+        main(suite(), args);
+    }
+
+    public static Test suite() {
+        return new TestSuite(TimeUnit8Test.class);
+    }
+
+    /**
+     * tests for toChronoUnit.
+     */
+    public void testToChronoUnit() throws Exception {
+        assertSame(ChronoUnit.NANOS,   NANOSECONDS.toChronoUnit());
+        assertSame(ChronoUnit.MICROS,  MICROSECONDS.toChronoUnit());
+        assertSame(ChronoUnit.MILLIS,  MILLISECONDS.toChronoUnit());
+        assertSame(ChronoUnit.SECONDS, SECONDS.toChronoUnit());
+        assertSame(ChronoUnit.MINUTES, MINUTES.toChronoUnit());
+        assertSame(ChronoUnit.HOURS,   HOURS.toChronoUnit());
+        assertSame(ChronoUnit.DAYS,    DAYS.toChronoUnit());
+
+        // Every TimeUnit has a defined ChronoUnit equivalent
+        for (TimeUnit x : TimeUnit.values())
+            assertSame(x, TimeUnit.of(x.toChronoUnit()));
+    }
+
+    /**
+     * tests for TimeUnit.of(ChronoUnit).
+     */
+    public void testTimeUnitOf() throws Exception {
+        assertSame(NANOSECONDS,  TimeUnit.of(ChronoUnit.NANOS));
+        assertSame(MICROSECONDS, TimeUnit.of(ChronoUnit.MICROS));
+        assertSame(MILLISECONDS, TimeUnit.of(ChronoUnit.MILLIS));
+        assertSame(SECONDS,      TimeUnit.of(ChronoUnit.SECONDS));
+        assertSame(MINUTES,      TimeUnit.of(ChronoUnit.MINUTES));
+        assertSame(HOURS,        TimeUnit.of(ChronoUnit.HOURS));
+        assertSame(DAYS,         TimeUnit.of(ChronoUnit.DAYS));
+
+        assertThrows(NullPointerException.class,
+                     () -> TimeUnit.of((ChronoUnit)null));
+
+        // ChronoUnits either round trip to their TimeUnit
+        // equivalents, or throw IllegalArgumentException.
+        for (ChronoUnit cu : ChronoUnit.values()) {
+            final TimeUnit tu;
+            try {
+                tu = TimeUnit.of(cu);
+            } catch (IllegalArgumentException acceptable) {
+                continue;
+            }
+            assertSame(cu, tu.toChronoUnit());
+        }
+    }
+
+}
--- a/test/java/util/concurrent/tck/TimeUnitTest.java	Thu Mar 31 01:13:26 2016 -0700
+++ b/test/java/util/concurrent/tck/TimeUnitTest.java	Thu Mar 31 09:00:24 2016 -0700
@@ -41,7 +41,6 @@
 import static java.util.concurrent.TimeUnit.NANOSECONDS;
 import static java.util.concurrent.TimeUnit.SECONDS;
 
-import java.time.temporal.ChronoUnit;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
@@ -124,6 +123,15 @@
             assertEquals(t,
                          NANOSECONDS.convert(t, NANOSECONDS));
         }
+
+        for (TimeUnit x : TimeUnit.values()) {
+            long[] zs = {
+                0, 1, -1,
+                Integer.MAX_VALUE, Integer.MIN_VALUE,
+                Long.MAX_VALUE, Long.MIN_VALUE,
+            };
+            for (long z : zs) assertEquals(z, x.convert(z, x));
+        }
     }
 
     /**
@@ -308,6 +316,27 @@
                      NANOSECONDS.convert(Long.MAX_VALUE / 2, DAYS));
         assertEquals(Long.MIN_VALUE,
                      NANOSECONDS.convert(-Long.MAX_VALUE / 4, DAYS));
+
+        for (TimeUnit x : TimeUnit.values())
+            for (TimeUnit y : TimeUnit.values()) {
+                long ratio = x.toNanos(1) / y.toNanos(1);
+                if (ratio >= 1) {
+                    assertEquals(ratio, y.convert(1, x));
+                    assertEquals(1, x.convert(ratio, y));
+                    long max = Long.MAX_VALUE/ratio;
+                    assertEquals(max * ratio, y.convert(max, x));
+                    assertEquals(-max * ratio, y.convert(-max, x));
+                    assertEquals(max, x.convert(max * ratio, y));
+                    assertEquals(-max, x.convert(-max * ratio, y));
+                    if (max < Long.MAX_VALUE) {
+                        assertEquals(Long.MAX_VALUE, y.convert(max + 1, x));
+                        assertEquals(Long.MIN_VALUE, y.convert(-max - 1, x));
+                        assertEquals(Long.MIN_VALUE, y.convert(Long.MIN_VALUE + 1, x));
+                    }
+                    assertEquals(Long.MAX_VALUE, y.convert(Long.MAX_VALUE, x));
+                    assertEquals(Long.MIN_VALUE, y.convert(Long.MIN_VALUE, x));
+                }
+            }
     }
 
     /**
@@ -319,6 +348,146 @@
                      MILLISECONDS.toNanos(Long.MAX_VALUE / 2));
         assertEquals(Long.MIN_VALUE,
                      MILLISECONDS.toNanos(-Long.MAX_VALUE / 3));
+
+        for (TimeUnit x : TimeUnit.values()) {
+            long ratio = x.toNanos(1) / NANOSECONDS.toNanos(1);
+            if (ratio >= 1) {
+                long max = Long.MAX_VALUE/ratio;
+                for (long z : new long[] {0, 1, -1, max, -max})
+                    assertEquals(z * ratio, x.toNanos(z));
+                if (max < Long.MAX_VALUE) {
+                    assertEquals(Long.MAX_VALUE, x.toNanos(max + 1));
+                    assertEquals(Long.MIN_VALUE, x.toNanos(-max - 1));
+                    assertEquals(Long.MIN_VALUE, x.toNanos(Long.MIN_VALUE + 1));
+                }
+                assertEquals(Long.MAX_VALUE, x.toNanos(Long.MAX_VALUE));
+                assertEquals(Long.MIN_VALUE, x.toNanos(Long.MIN_VALUE));
+                if (max < Integer.MAX_VALUE) {
+                    assertEquals(Long.MAX_VALUE, x.toNanos(Integer.MAX_VALUE));
+                    assertEquals(Long.MIN_VALUE, x.toNanos(Integer.MIN_VALUE));
+                }
+            }
+        }
+    }
+
+    /**
+     * toMicros saturates positive too-large values to Long.MAX_VALUE
+     * and negative to LONG.MIN_VALUE
+     */
+    public void testToMicrosSaturate() {
+        for (TimeUnit x : TimeUnit.values()) {
+            long ratio = x.toNanos(1) / MICROSECONDS.toNanos(1);
+            if (ratio >= 1) {
+                long max = Long.MAX_VALUE/ratio;
+                for (long z : new long[] {0, 1, -1, max, -max})
+                    assertEquals(z * ratio, x.toMicros(z));
+                if (max < Long.MAX_VALUE) {
+                    assertEquals(Long.MAX_VALUE, x.toMicros(max + 1));
+                    assertEquals(Long.MIN_VALUE, x.toMicros(-max - 1));
+                    assertEquals(Long.MIN_VALUE, x.toMicros(Long.MIN_VALUE + 1));
+                }
+                assertEquals(Long.MAX_VALUE, x.toMicros(Long.MAX_VALUE));
+                assertEquals(Long.MIN_VALUE, x.toMicros(Long.MIN_VALUE));
+                if (max < Integer.MAX_VALUE) {
+                    assertEquals(Long.MAX_VALUE, x.toMicros(Integer.MAX_VALUE));
+                    assertEquals(Long.MIN_VALUE, x.toMicros(Integer.MIN_VALUE));
+                }
+            }
+        }
+    }
+
+    /**
+     * toMillis saturates positive too-large values to Long.MAX_VALUE
+     * and negative to LONG.MIN_VALUE
+     */
+    public void testToMillisSaturate() {
+        for (TimeUnit x : TimeUnit.values()) {
+            long ratio = x.toNanos(1) / MILLISECONDS.toNanos(1);
+            if (ratio >= 1) {
+                long max = Long.MAX_VALUE/ratio;
+                for (long z : new long[] {0, 1, -1, max, -max})
+                    assertEquals(z * ratio, x.toMillis(z));
+                if (max < Long.MAX_VALUE) {
+                    assertEquals(Long.MAX_VALUE, x.toMillis(max + 1));
+                    assertEquals(Long.MIN_VALUE, x.toMillis(-max - 1));
+                    assertEquals(Long.MIN_VALUE, x.toMillis(Long.MIN_VALUE + 1));
+                }