Merge
authorjdv
Wed, 04 Apr 2018 14:32:05 +0530
changeset 49688 c4460ca1f08c
parent 49687 23ffd7bf415e (current diff)
parent 49519 94129cb29710 (diff)
child 49689 a38e7ef21cc0
Merge
--- a/.hgtags	Mon Apr 02 16:56:58 2018 +0530
+++ b/.hgtags	Wed Apr 04 14:32:05 2018 +0530
@@ -477,3 +477,4 @@
 e59941f7247d451fa7df9eaef3fce0f492f8420c jdk-11+4
 d5c43e9f08fb9a7c74aae0d48daf17f2ad2afaef jdk-11+5
 3acb379b86725c47e7f33358cb22efa8752ae532 jdk-11+6
+f7363de371c9a1f668bd0a01b7df3d1ddb9cc58b jdk-11+7
--- a/make/autoconf/toolchain.m4	Mon Apr 02 16:56:58 2018 +0530
+++ b/make/autoconf/toolchain.m4	Wed Apr 04 14:32:05 2018 +0530
@@ -597,8 +597,9 @@
 
     # solstudio cc requires us to have an existing file to pass as argument,
     # but it need not be a syntactically correct C file, so just use
-    # ourself. :)
-    LINKER_VERSION_STRING=`$LD -Wl,-V $TOPDIR/configure 2>&1 | $HEAD -n 1 | $SED -e 's/ld: //'`
+    # ourself. :) The intermediate 'cat' is needed to stop ld from leaving
+    # a lingering a.out (!).
+    LINKER_VERSION_STRING=`$LD -Wl,-V $TOPDIR/configure 2>&1 | $CAT | $HEAD -n 1 | $SED -e 's/ld: //'`
     # Extract version number
     [ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \
         $SED -e 's/.* \([0-9][0-9]*\.[0-9][0-9]*\)-\([0-9][0-9]*\.[0-9][0-9]*\)/\1.\2/'` ]
--- a/make/autoconf/version-numbers	Mon Apr 02 16:56:58 2018 +0530
+++ b/make/autoconf/version-numbers	Wed Apr 04 14:32:05 2018 +0530
@@ -29,7 +29,7 @@
 DEFAULT_VERSION_INTERIM=0
 DEFAULT_VERSION_UPDATE=0
 DEFAULT_VERSION_PATCH=0
-DEFAULT_VERSION_DATE=2018-09-18
+DEFAULT_VERSION_DATE=2018-09-25
 DEFAULT_VERSION_CLASSFILE_MAJOR=55  # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
 DEFAULT_VERSION_CLASSFILE_MINOR=0
 DEFAULT_ACCEPTABLE_BOOT_VERSIONS="9 10 11"
--- a/make/common/NativeCompilation.gmk	Mon Apr 02 16:56:58 2018 +0530
+++ b/make/common/NativeCompilation.gmk	Wed Apr 04 14:32:05 2018 +0530
@@ -292,8 +292,7 @@
     endif
 
     ifneq ($$(strip $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION)), )
-      $1_VARDEPS := $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPT_CFLAGS) \
-          $$($1_OPT_CXXFLAGS)
+      $1_VARDEPS := $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION)
       $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_OBJ).vardeps)
     endif
 
--- a/make/conf/jib-profiles.js	Mon Apr 02 16:56:58 2018 +0530
+++ b/make/conf/jib-profiles.js	Wed Apr 04 14:32:05 2018 +0530
@@ -816,7 +816,7 @@
 var getJibProfilesDependencies = function (input, common) {
 
     var devkit_platform_revisions = {
-        linux_x64: "gcc4.9.2-OEL6.4+1.3",
+        linux_x64: "gcc7.3.0-OEL6.4+1.0",
         macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
         solaris_x64: "SS12u4-Solaris11u1+1.0",
         solaris_sparcv9: "SS12u4-Solaris11u1+1.1",
--- a/make/lib/Awt2dLibraries.gmk	Mon Apr 02 16:56:58 2018 +0530
+++ b/make/lib/Awt2dLibraries.gmk	Wed Apr 04 14:32:05 2018 +0530
@@ -543,7 +543,7 @@
       DISABLED_WARNINGS_solstudio := \
          E_STATEMENT_NOT_REACHED \
          E_END_OF_LOOP_CODE_NOT_REACHED, \
-      DISABLED_WARNINGS_microsoft := 4267 2220 4244, \
+      DISABLED_WARNINGS_microsoft := 4267 4244, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
   ))
--- a/src/java.base/share/classes/java/lang/Boolean.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.base/share/classes/java/lang/Boolean.java	Wed Apr 04 14:32:05 2018 +0530
@@ -129,7 +129,7 @@
      * @since 1.5
      */
     public static boolean parseBoolean(String s) {
-        return ((s != null) && s.equalsIgnoreCase("true"));
+        return "true".equalsIgnoreCase(s);
     }
 
     /**
--- a/src/java.base/share/classes/java/lang/ClassLoader.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.base/share/classes/java/lang/ClassLoader.java	Wed Apr 04 14:32:05 2018 +0530
@@ -73,7 +73,7 @@
 /**
  * A class loader is an object that is responsible for loading classes. The
  * class {@code ClassLoader} is an abstract class.  Given the <a
- * href="#name">binary name</a> of a class, a class loader should attempt to
+ * href="#binary-name">binary name</a> of a class, a class loader should attempt to
  * locate or generate data that constitutes a definition for the class.  A
  * typical strategy is to transform the name into a file name and then read a
  * "class file" of that name from a file system.
@@ -202,7 +202,7 @@
  *     }
  * </pre></blockquote>
  *
- * <h3> <a id="name">Binary names</a> </h3>
+ * <h3> <a id="binary-name">Binary names</a> </h3>
  *
  * <p> Any class name provided as a {@code String} parameter to methods in
  * {@code ClassLoader} must be a binary name as defined by
@@ -480,7 +480,7 @@
     // -- Class --
 
     /**
-     * Loads the class with the specified <a href="#name">binary name</a>.
+     * Loads the class with the specified <a href="#binary-name">binary name</a>.
      * This method searches for classes in the same manner as the {@link
      * #loadClass(String, boolean)} method.  It is invoked by the Java virtual
      * machine to resolve class references.  Invoking this method is equivalent
@@ -488,7 +488,7 @@
      * false)}.
      *
      * @param  name
-     *         The <a href="#name">binary name</a> of the class
+     *         The <a href="#binary-name">binary name</a> of the class
      *
      * @return  The resulting {@code Class} object
      *
@@ -500,7 +500,7 @@
     }
 
     /**
-     * Loads the class with the specified <a href="#name">binary name</a>.  The
+     * Loads the class with the specified <a href="#binary-name">binary name</a>.  The
      * default implementation of this method searches for classes in the
      * following order:
      *
@@ -530,7 +530,7 @@
      * during the entire class loading process.
      *
      * @param  name
-     *         The <a href="#name">binary name</a> of the class
+     *         The <a href="#binary-name">binary name</a> of the class
      *
      * @param  resolve
      *         If {@code true} then resolve the class
@@ -579,7 +579,7 @@
     }
 
     /**
-     * Loads the class with the specified <a href="#name">binary name</a>
+     * Loads the class with the specified <a href="#binary-name">binary name</a>
      * in a module defined to this class loader.  This method returns {@code null}
      * if the class could not be found.
      *
@@ -598,7 +598,7 @@
      * @param  module
      *         The module
      * @param  name
-     *         The <a href="#name">binary name</a> of the class
+     *         The <a href="#binary-name">binary name</a> of the class
      *
      * @return The resulting {@code Class} object in a module defined by
      *         this class loader, or {@code null} if the class could not be found.
@@ -674,7 +674,7 @@
     }
 
     /**
-     * Finds the class with the specified <a href="#name">binary name</a>.
+     * Finds the class with the specified <a href="#binary-name">binary name</a>.
      * This method should be overridden by class loader implementations that
      * follow the delegation model for loading classes, and will be invoked by
      * the {@link #loadClass loadClass} method after checking the
@@ -683,7 +683,7 @@
      * @implSpec The default implementation throws {@code ClassNotFoundException}.
      *
      * @param  name
-     *         The <a href="#name">binary name</a> of the class
+     *         The <a href="#binary-name">binary name</a> of the class
      *
      * @return  The resulting {@code Class} object
      *
@@ -697,7 +697,7 @@
     }
 
     /**
-     * Finds the class with the given <a href="#name">binary name</a>
+     * Finds the class with the given <a href="#binary-name">binary name</a>
      * in a module defined to this class loader.
      * Class loader implementations that support the loading from modules
      * should override this method.
@@ -715,7 +715,7 @@
      *         class loader
 
      * @param  name
-     *         The <a href="#name">binary name</a> of the class
+     *         The <a href="#binary-name">binary name</a> of the class
      *
      * @return The resulting {@code Class} object, or {@code null}
      *         if the class could not be found.
@@ -737,7 +737,7 @@
      * Converts an array of bytes into an instance of class {@code Class}.
      * Before the {@code Class} can be used it must be resolved.  This method
      * is deprecated in favor of the version that takes a <a
-     * href="#name">binary name</a> as its first argument, and is more secure.
+     * href="#binary-name">binary name</a> as its first argument, and is more secure.
      *
      * @param  b
      *         The bytes that make up the class data.  The bytes in positions
@@ -804,12 +804,12 @@
      * This method defines a package in this class loader corresponding to the
      * package of the {@code Class} (if such a package has not already been defined
      * in this class loader). The name of the defined package is derived from
-     * the <a href="#name">binary name</a> of the class specified by
+     * the <a href="#binary-name">binary name</a> of the class specified by
      * the byte array {@code b}.
      * Other properties of the defined package are as specified by {@link Package}.
      *
      * @param  name
-     *         The expected <a href="#name">binary name</a> of the class, or
+     *         The expected <a href="#binary-name">binary name</a> of the class, or
      *         {@code null} if not known
      *
      * @param  b
@@ -923,7 +923,7 @@
      * package must contain the same set of certificates or a
      * {@code SecurityException} will be thrown.  Note that if
      * {@code name} is {@code null}, this check is not performed.
-     * You should always pass in the <a href="#name">binary name</a> of the
+     * You should always pass in the <a href="#binary-name">binary name</a> of the
      * class you are defining as well as the bytes.  This ensures that the
      * class you are defining is indeed the class you think it is.
      *
@@ -931,19 +931,19 @@
      * only be defined by the {@linkplain #getPlatformClassLoader()
      * platform class loader} or its ancestors; otherwise {@code SecurityException}
      * will be thrown.  If {@code name} is not {@code null}, it must be equal to
-     * the <a href="#name">binary name</a> of the class
+     * the <a href="#binary-name">binary name</a> of the class
      * specified by the byte array {@code b}, otherwise a {@link
      * NoClassDefFoundError NoClassDefFoundError} will be thrown.
      *
      * <p> This method defines a package in this class loader corresponding to the
      * package of the {@code Class} (if such a package has not already been defined
      * in this class loader). The name of the defined package is derived from
-     * the <a href="#name">binary name</a> of the class specified by
+     * the <a href="#binary-name">binary name</a> of the class specified by
      * the byte array {@code b}.
      * Other properties of the defined package are as specified by {@link Package}.
      *
      * @param  name
-     *         The expected <a href="#name">binary name</a> of the class, or
+     *         The expected <a href="#binary-name">binary name</a> of the class, or
      *         {@code null} if not known
      *
      * @param  b
@@ -969,7 +969,7 @@
      *
      * @throws  NoClassDefFoundError
      *          If {@code name} is not {@code null} and not equal to the
-     *          <a href="#name">binary name</a> of the class specified by {@code b}
+     *          <a href="#binary-name">binary name</a> of the class specified by {@code b}
      *
      * @throws  IndexOutOfBoundsException
      *          If either {@code off} or {@code len} is negative, or if
@@ -1027,7 +1027,7 @@
      * </code></p>
      *
      * @param  name
-     *         The expected <a href="#name">binary name</a>. of the class, or
+     *         The expected <a href="#binary-name">binary name</a>. of the class, or
      *         {@code null} if not known
      *
      * @param  b
@@ -1047,7 +1047,7 @@
      *
      * @throws  NoClassDefFoundError
      *          If {@code name} is not {@code null} and not equal to the
-     *          <a href="#name">binary name</a> of the class specified by {@code b}
+     *          <a href="#binary-name">binary name</a> of the class specified by {@code b}
      *
      * @throws  SecurityException
      *          If an attempt is made to add this class to a package that
@@ -1198,7 +1198,7 @@
     }
 
     /**
-     * Finds a class with the specified <a href="#name">binary name</a>,
+     * Finds a class with the specified <a href="#binary-name">binary name</a>,
      * loading it if necessary.
      *
      * <p> This method loads the class through the system class loader (see
@@ -1209,7 +1209,7 @@
      * #findClass(String)}.  </p>
      *
      * @param  name
-     *         The <a href="#name">binary name</a> of the class
+     *         The <a href="#binary-name">binary name</a> of the class
      *
      * @return  The {@code Class} object for the specified {@code name}
      *
@@ -1239,13 +1239,13 @@
     private native Class<?> findBootstrapClass(String name);
 
     /**
-     * Returns the class with the given <a href="#name">binary name</a> if this
+     * Returns the class with the given <a href="#binary-name">binary name</a> if this
      * loader has been recorded by the Java virtual machine as an initiating
-     * loader of a class with that <a href="#name">binary name</a>.  Otherwise
+     * loader of a class with that <a href="#binary-name">binary name</a>.  Otherwise
      * {@code null} is returned.
      *
      * @param  name
-     *         The <a href="#name">binary name</a> of the class
+     *         The <a href="#binary-name">binary name</a> of the class
      *
      * @return  The {@code Class} object, or {@code null} if the class has
      *          not been loaded
@@ -2087,9 +2087,9 @@
     }
 
     /**
-     * Defines a package by <a href="#name">name</a> in this {@code ClassLoader}.
+     * Defines a package by <a href="#binary-name">name</a> in this {@code ClassLoader}.
      * <p>
-     * <a href="#name">Package names</a> must be unique within a class loader and
+     * <a href="#binary-name">Package names</a> must be unique within a class loader and
      * cannot be redefined or changed once created.
      * <p>
      * If a class loader wishes to define a package with specific properties,
@@ -2123,7 +2123,7 @@
      * in a named module may be for example sealed with different seal base.
      *
      * @param  name
-     *         The <a href="#name">package name</a>
+     *         The <a href="#binary-name">package name</a>
      *
      * @param  specTitle
      *         The specification title
@@ -2185,10 +2185,10 @@
     }
 
     /**
-     * Returns a {@code Package} of the given <a href="#name">name</a> that
+     * Returns a {@code Package} of the given <a href="#binary-name">name</a> that
      * has been defined by this class loader.
      *
-     * @param  name The <a href="#name">package name</a>
+     * @param  name The <a href="#binary-name">package name</a>
      *
      * @return The {@code Package} of the given name that has been defined
      *         by this class loader, or {@code null} if not found
@@ -2233,7 +2233,7 @@
     }
 
     /**
-     * Finds a package by <a href="#name">name</a> in this class loader and its ancestors.
+     * Finds a package by <a href="#binary-name">name</a> in this class loader and its ancestors.
      * <p>
      * If this class loader defines a {@code Package} of the given name,
      * the {@code Package} is returned. Otherwise, the ancestors of
@@ -2247,7 +2247,7 @@
      * class loader.
      *
      * @param  name
-     *         The <a href="#name">package name</a>
+     *         The <a href="#binary-name">package name</a>
      *
      * @return The {@code Package} of the given name that has been defined by
      *         this class loader or its ancestors, or {@code null} if not found.
--- a/src/java.base/share/classes/java/lang/Runtime.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.base/share/classes/java/lang/Runtime.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1140,7 +1140,7 @@
          * number is not the major-release number but the feature-release
          * counter, incremented for every time-based release.  Use the {@link
          * #feature()} method in preference to this method.  For compatibility,
-         * this method returns the value of the <a href="FEATURE">feature</a>
+         * this method returns the value of the <a href="#FEATURE">feature</a>
          * element.
          *
          * @return The value of the feature element
@@ -1158,7 +1158,7 @@
          * number is not the minor-release number but the interim-release
          * counter, incremented for every interim release.  Use the {@link
          * #interim()} method in preference to this method.  For compatibility,
-         * this method returns the value of the <a href="INTERIM">interim</a>
+         * this method returns the value of the <a href="#INTERIM">interim</a>
          * element, or zero if it is absent.
          *
          * @return The value of the interim element, or zero
@@ -1176,7 +1176,7 @@
          * number is not the security level but the update-release counter,
          * incremented for every update release.  Use the {@link #update()}
          * method in preference to this method.  For compatibility, this method
-         * returns the value of the <a href="UPDATE">update</a> element, or
+         * returns the value of the <a href="#UPDATE">update</a> element, or
          * zero if it is absent.
          *
          * @return  The value of the update element, or zero
@@ -1188,9 +1188,9 @@
 
         /**
          * Returns an unmodifiable {@link java.util.List List} of the integers
-         * represented in the <a href="#verNum">version number</a>.  The {@code
-         * List} always contains at least one element corresponding to the <a
-         * href="#feature">feature version number</a>.
+         * represented in the <a href="#verNum">version number</a>.
+         * The {@code List} always contains at least one element corresponding to
+         * the <a href="#FEATURE">feature version number</a>.
          *
          * @return  An unmodifiable list of the integers
          *          represented in the version number
--- a/src/java.base/share/classes/java/lang/package-info.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.base/share/classes/java/lang/package-info.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@
  * represent errors and exceptions.
  *
  * <a id="charenc"></a>
- * <h3>Character Encodings</h3>
+ * <h2>Character Encodings</h2>
  *
  * The specification of the {@link java.nio.charset.Charset
  * java.nio.charset.Charset} class describes the naming conventions
--- a/src/java.base/share/classes/java/nio/file/package-info.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.base/share/classes/java/nio/file/package-info.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
  * package is used by service provider implementors wishing to extend the
  * platform default provider, or to construct other provider implementations. </p>
  *
- * <h3><a id="links">Symbolic Links</a></h3>
+ * <h2><a id="links">Symbolic Links</a></h2>
  * <p> Many operating systems and file systems support for <em>symbolic links</em>.
  * A symbolic link is a special file that serves as a reference to another file.
  * For the most part, symbolic links are transparent to applications and
@@ -45,7 +45,7 @@
  * that are semantically close but support for these other types of links is
  * not included in this package. </p>
  *
- * <h3><a id="interop">Interoperability</a></h3>
+ * <h2><a id="interop">Interoperability</a></h2>
  * <p> The {@link java.io.File} class defines the {@link java.io.File#toPath
  * toPath} method to construct a {@link java.nio.file.Path} by converting
  * the abstract path represented by the {@code java.io.File} object. The resulting
@@ -54,7 +54,7 @@
  * on the <a href="Path.html#interop">interoperability</a> between {@code Path}
  * and {@code java.io.File} objects. </p>
  *
- * <h3>Visibility</h3>
+ * <h2>Visibility</h2>
  * <p> The view of the files and file system provided by classes in this package are
  * guaranteed to be consistent with other views provided by other instances in the
  * same Java virtual machine.  The view may or may not, however, be consistent with
@@ -65,7 +65,7 @@
  * or on some other machine.  The exact nature of any such inconsistencies are
  * system-dependent and are therefore unspecified. </p>
  *
- * <h3><a id="integrity">Synchronized I/O File Integrity</a></h3>
+ * <h2><a id="integrity">Synchronized I/O File Integrity</a></h2>
  * <p> The {@link java.nio.file.StandardOpenOption#SYNC SYNC} and {@link
  * java.nio.file.StandardOpenOption#DSYNC DSYNC} options are used when opening a file
  * to require that updates to the file are written synchronously to the underlying
@@ -82,7 +82,7 @@
  * java.nio.file.spi.FileSystemProvider provider} implementations is provider
  * specific. </p>
  *
- * <h3>General Exceptions</h3>
+ * <h2>General Exceptions</h2>
  * <p> Unless otherwise noted, passing a {@code null} argument to a constructor
  * or method of any class or interface in this package will cause a {@link
  * java.lang.NullPointerException NullPointerException} to be thrown. Additionally,
@@ -103,7 +103,7 @@
  * provider} with a parameter that is an object created by another provider,
  * will throw {@link java.nio.file.ProviderMismatchException}. </p>
  *
- * <h3>Optional Specific Exceptions</h3>
+ * <h2>Optional Specific Exceptions</h2>
  * Most of the methods defined by classes in this package that access the
  * file system specify that {@link java.io.IOException} be thrown when an I/O
  * error occurs. In some cases, these methods define specific I/O exceptions
--- a/src/java.base/share/classes/java/text/ChoiceFormat.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.base/share/classes/java/text/ChoiceFormat.java	Wed Apr 04 14:32:05 2018 +0530
@@ -212,7 +212,7 @@
                 } else if (tempBuffer.equals("-\u221E")) {
                     startValue = Double.NEGATIVE_INFINITY;
                 } else {
-                    startValue = Double.valueOf(tempBuffer);
+                    startValue = Double.parseDouble(tempBuffer);
                 }
 
                 if (ch == '<' && startValue != Double.POSITIVE_INFINITY &&
--- a/src/java.base/share/classes/java/time/chrono/package-info.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.base/share/classes/java/time/chrono/package-info.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@
  * <li>{@link java.time.chrono.ThaiBuddhistChronology Thai Buddhist calendar}</li>
  * </ul>
  *
- * <h3>Example</h3>
+ * <h2>Example</h2>
  * <p>
  * This example lists todays date for all of the available calendars.
  * </p>
@@ -155,7 +155,7 @@
  *                 first, last);
  *  </pre>
  *
- * <h3>Package specification</h3>
+ * <h2>Package specification</h2>
  * <p>
  * Unless otherwise noted, passing a null argument to a constructor or method in any class or interface
  * in this package will cause a {@link java.lang.NullPointerException NullPointerException} to be thrown.
--- a/src/java.base/share/classes/java/time/format/package-info.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.base/share/classes/java/time/format/package-info.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -79,7 +79,7 @@
  * {@link java.time.format.DecimalStyle DecimalStyle}.
  * </p>
  *
- * <h3>Package specification</h3>
+ * <h2>Package specification</h2>
  * <p>
  * Unless otherwise noted, passing a null argument to a constructor or method in any class or interface
  * in this package will cause a {@link java.lang.NullPointerException NullPointerException} to be thrown.
--- a/src/java.base/share/classes/java/time/package-info.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.base/share/classes/java/time/package-info.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,7 +90,7 @@
  * The calendar neutral API should be reserved for interactions with users.
  * </p>
  *
- * <h3>Dates and Times</h3>
+ * <h2>Dates and Times</h2>
  * <p>
  * {@link java.time.Instant} is essentially a numeric timestamp.
  * The current Instant can be retrieved from a {@link java.time.Clock}.
@@ -118,7 +118,7 @@
  * The widespread use of time-zones tends to add considerable complexity to an application.
  * </p>
  *
- * <h3>Duration and Period</h3>
+ * <h2>Duration and Period</h2>
  * <p>
  * Beyond dates and times, the API also allows the storage of periods and durations of time.
  * A {@link java.time.Duration} is a simple measure of time along the time-line in nanoseconds.
@@ -126,7 +126,7 @@
  * to humans, such as years or days.
  * </p>
  *
- * <h3>Additional value types</h3>
+ * <h2>Additional value types</h2>
  * <p>
  * {@link java.time.Month} stores a month on its own.
  * This stores a single month-of-year in isolation, such as 'DECEMBER'.
@@ -160,7 +160,7 @@
  * but contains less information than a full time-zone.
  * </p>
  *
- * <h3>Package specification</h3>
+ * <h2>Package specification</h2>
  * <p>
  * Unless otherwise noted, passing a null argument to a constructor or method in any class or interface
  * in this package will cause a {@link java.lang.NullPointerException NullPointerException} to be thrown.
@@ -172,7 +172,7 @@
  * or a {@link java.time.DateTimeException}.
  * </p>
  *
- * <h3>Design notes (non normative)</h3>
+ * <h2>Design notes (non normative)</h2>
  * <p>
  * The API has been designed to reject null early and to be clear about this behavior.
  * A key exception is any method that takes an object and returns a boolean, for the purpose
--- a/src/java.base/share/classes/java/time/temporal/package-info.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.base/share/classes/java/time/temporal/package-info.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@
  * <li>Different definitions of weeks</li>
  * </ul>
  *
- * <h3>Fields and Units</h3>
+ * <h2>Fields and Units</h2>
  * <p>
  * Dates and times are expressed in terms of fields and units.
  * A unit is used to measure an amount of time, such as years, days or minutes.
@@ -106,7 +106,7 @@
  * The fields also provide access to the range of valid values.
  * </p>
  *
- * <h3>Adjustment and Query</h3>
+ * <h2>Adjustment and Query</h2>
  * <p>
  * A key part of the date-time problem space is adjusting a date to a new, related value,
  * such as the "last day of the month", or "next Wednesday".
@@ -131,7 +131,7 @@
  * Applications can also define queries by implementing {@link java.time.temporal.TemporalQuery}.
  * </p>
  *
- * <h3>Weeks</h3>
+ * <h2>Weeks</h2>
  * <p>
  * Different locales have different definitions of the week.
  * For example, in Europe the week typically starts on a Monday, while in the US it starts on a Sunday.
@@ -143,7 +143,7 @@
  * This is modeled in {@link java.time.temporal.IsoFields}.
  * </p>
  *
- * <h3>Package specification</h3>
+ * <h2>Package specification</h2>
  * <p>
  * Unless otherwise noted, passing a null argument to a constructor or method in any class or interface
  * in this package will cause a {@link java.lang.NullPointerException NullPointerException} to be thrown.
--- a/src/java.base/share/classes/java/time/zone/package-info.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.base/share/classes/java/time/zone/package-info.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,7 +70,7 @@
  * gaps and overlaps in the local time-line typically caused by Daylight Saving Time.
  * </p>
  *
- * <h3>Package specification</h3>
+ * <h2>Package specification</h2>
  * <p>
  * Unless otherwise noted, passing a null argument to a constructor or method in any class or interface
  * in this package will cause a {@link java.lang.NullPointerException NullPointerException} to be thrown.
--- a/src/java.logging/share/classes/java/util/logging/Logger.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.logging/share/classes/java/util/logging/Logger.java	Wed Apr 04 14:32:05 2018 +0530
@@ -640,7 +640,7 @@
                     return System.getProperty(key);
                 }
             });
-            return Boolean.valueOf(s);
+            return Boolean.parseBoolean(s);
         }
     }
 
--- a/src/java.xml/share/classes/javax/xml/transform/package-info.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.xml/share/classes/javax/xml/transform/package-info.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
  * {@link javax.xml.transform.stax}, and {@link javax.xml.transform.stream}.
  *
  *
- * <h3>Creating Objects</h3>
+ * <h2>Creating Objects</h2>
  *
  * <p>
  * The API allows a concrete {@link javax.xml.transform.TransformerFactory}
@@ -46,7 +46,7 @@
  * {@link javax.xml.transform.TransformerFactory#newInstance}.
  *
  *
- * <h3>Specification of Inputs and Outputs</h3>
+ * <h2>Specification of Inputs and Outputs</h2>
  *
  * <p>
  * This API defines two interface objects called {@link javax.xml.transform.Source}
@@ -77,9 +77,7 @@
  * </pre>
  *
  *
- * <h3>
- * <a id="qname-delimiter">Qualified Name Representation</a>
- * </h3>
+ * <h2><a id="qname-delimiter">Qualified Name Representation</a></h2>
  *
  * <p>
  * <a href="http://www.w3.org/TR/REC-xml-names">Namespaces</a> present something
@@ -112,7 +110,7 @@
  * prefix is lost.
  *
  *
- * <h3>Result Tree Serialization</h3>
+ * <h2>Result Tree Serialization</h2>
  *
  * <p>
  * Serialization of the result tree to a stream can be controlled with the
@@ -141,7 +139,7 @@
  * the source to the result. This method may be used to create a DOM from SAX
  * events or to create an XML or HTML stream from a DOM or SAX events.
  *
- * <h3>Exceptions and Error Reporting</h3>
+ * <h2>Exceptions and Error Reporting</h2>
  *
  * <p>
  * The transformation API throw three types of specialized exceptions. A
@@ -192,7 +190,7 @@
  * errors.
  *
  *
- * <h3>Resolution of URIs within a transformation</h3>
+ * <h2>Resolution of URIs within a transformation</h2>
  *
  * <p>
  * The API provides a way for URIs referenced from within the stylesheet
--- a/src/java.xml/share/classes/javax/xml/xpath/package-info.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/java.xml/share/classes/javax/xml/xpath/package-info.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
  * </ul>
  * <p>
  * <a id="XPath.Overview"></a>
- * <h3>1. XPath Overview</h3>
+ * <h2>1. XPath Overview</h2>
  *
  * <p>
  * The XPath language provides a simple, concise syntax for selecting
@@ -69,7 +69,7 @@
  *
  *
  * <a id="XPath.Expressions"></a>
- * <h3>2. XPath Expressions</h3>
+ * <h2>2. XPath Expressions</h2>
  *
  * <p>
  * An XPath <em>expression</em> is composed of a <em>location
@@ -211,7 +211,7 @@
  * </blockquote>
  *
  * <a id="XPath.Datatypes"></a>
- * <h3>3. XPath Data Types</h3>
+ * <h2>3. XPath Data Types</h2>
  *
  * <p>
  * While XPath expressions select nodes in the XML document, the XPath
@@ -225,7 +225,7 @@
  * </ul>
  *
  * <a id="XPath.Datatypes.QName"></a>
- * <h3>3.1 QName types</h3>
+ * <h2>3.1 QName types</h2>
  * The XPath API defines the following {@link javax.xml.namespace.QName} types to
  * represent return types of an XPath evaluation:
  * <ul>
@@ -258,7 +258,7 @@
  * of a node to a <code>double</code> data type.
  *
  * <a id="XPath.Datatypes.Class"></a>
- * <h3>3.2 Class types</h3>
+ * <h2>3.2 Class types</h2>
  * In addition to the QName types, the XPath API supports the use of Class types
  * through the <code>XPathExpression.evaluteExpression(...)</code> or
  * <code>XPath.evaluateExpression(...)</code> methods.
@@ -276,14 +276,14 @@
  * Of the subtypes of Number, only Double, Integer and Long are supported.
  *
  * <a id="XPath.Datatypes.Enum"></a>
- * <h3>3.3 Enum types</h3>
+ * <h2>3.3 Enum types</h2>
  * Enum types are defined in {@link javax.xml.xpath.XPathEvaluationResult.XPathResultType}
  * that provide mappings between the QName and Class types above. The result of
  * evaluating an expression using the <code>XPathExpression.evaluteExpression(...)</code>
  * or <code>XPath.evaluateExpression(...)</code> methods will be of one of these types.
  *
  * <a id="XPath.Context"></a>
- * <h3>4. XPath Context</h3>
+ * <h2>4. XPath Context</h2>
  *
  * <p>
  * XPath location paths may be relative to a particular node in the
@@ -301,7 +301,7 @@
  * {@link org.w3c.dom.Node} for example, in the JDK implementation.
  *
  * <a id="XPath.Use"></a>
- * <h3>5. Using the XPath API</h3>
+ * <h2>5. Using the XPath API</h2>
  *
  * Consider the following XML document:
  * <blockquote>
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java	Wed Apr 04 14:32:05 2018 +0530
@@ -520,24 +520,24 @@
 
     XDIAGS("-Xdiags:", "opt.diags", EXTENDED, BASIC, ONEOF, "compact", "verbose"),
 
-    DEBUG("--debug:", null, HIDDEN, BASIC) {
+    DEBUG("--debug", null, HIDDEN, BASIC, ArgKind.REQUIRED) {
         @Override
-        public void process(OptionHelper helper, String option) throws InvalidValueException {
-            HiddenGroup.DEBUG.process(helper, option);
+        public void process(OptionHelper helper, String option, String arg) throws InvalidValueException {
+            HiddenGroup.DEBUG.process(helper, option, arg);
         }
     },
 
-    SHOULDSTOP("--should-stop:", null, HIDDEN, BASIC) {
+    SHOULDSTOP("--should-stop", null, HIDDEN, BASIC, ArgKind.REQUIRED) {
         @Override
-        public void process(OptionHelper helper, String option) throws InvalidValueException {
-            HiddenGroup.SHOULDSTOP.process(helper, option);
+        public void process(OptionHelper helper, String option, String arg) throws InvalidValueException {
+            HiddenGroup.SHOULDSTOP.process(helper, option, arg);
         }
     },
 
-    DIAGS("--diags:", null, HIDDEN, BASIC) {
+    DIAGS("--diags", null, HIDDEN, BASIC, ArgKind.REQUIRED) {
         @Override
-        public void process(OptionHelper helper, String option) throws InvalidValueException {
-            HiddenGroup.DIAGS.process(helper, option);
+        public void process(OptionHelper helper, String option, String arg) throws InvalidValueException {
+            HiddenGroup.DIAGS.process(helper, option, arg);
         }
     },
 
@@ -846,27 +846,19 @@
         DEBUG("debug"),
         SHOULDSTOP("should-stop");
 
-        static final Set<String> skipSet = new java.util.HashSet<>(
-                Arrays.asList("--diags:", "--debug:", "--should-stop:"));
-
         final String text;
 
         HiddenGroup(String text) {
             this.text = text;
         }
 
-        public void process(OptionHelper helper, String option) throws InvalidValueException {
-            String p = option.substring(option.indexOf(':') + 1).trim();
-            String[] subOptions = p.split(";");
+        public void process(OptionHelper helper, String option, String arg) throws InvalidValueException {
+            String[] subOptions = arg.split(";");
             for (String subOption : subOptions) {
                 subOption = text + "." + subOption.trim();
                 XD.process(helper, subOption, subOption);
             }
         }
-
-        static boolean skip(String name) {
-            return skipSet.contains(name);
-        }
     }
 
     /**
@@ -957,6 +949,11 @@
         this(text, null, descrKey, kind, group, null, null, ArgKind.NONE);
     }
 
+    Option(String text, String descrKey,
+            OptionKind kind, OptionGroup group, ArgKind argKind) {
+        this(text, null, descrKey, kind, group, null, null, argKind);
+    }
+
     Option(String text, String argsNameKey, String descrKey,
             OptionKind kind, OptionGroup group) {
         this(text, argsNameKey, descrKey, kind, group, null, null, ArgKind.REQUIRED);
@@ -1025,7 +1022,7 @@
     }
 
     private boolean matches(String option, String name) {
-        if (name.startsWith("--") && !HiddenGroup.skip(name)) {
+        if (name.startsWith("--")) {
             return option.equals(name)
                     || hasArg() && option.startsWith(name + "=");
         }
--- a/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -313,7 +313,7 @@
         }
 
         // Enable dependency generation
-        args.add("--debug:completionDeps=source,class");
+        args.add("--debug=completionDeps=source,class");
 
         // This can't be anything but 'none'. Enforced by sjavac main method.
         args.add("-implicit:" + implicitPolicy);
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Wed Apr 04 14:32:05 2018 +0530
@@ -81,6 +81,7 @@
 import jdk.jshell.ImportSnippet;
 import jdk.jshell.JShell;
 import jdk.jshell.JShell.Subscription;
+import jdk.jshell.JShellException;
 import jdk.jshell.MethodSnippet;
 import jdk.jshell.Snippet;
 import jdk.jshell.Snippet.Kind;
@@ -3357,21 +3358,61 @@
     /**
      * Print out a snippet exception.
      *
-     * @param exception the exception to print
+     * @param exception the throwable to print
      * @return true on fatal exception
      */
-    private boolean displayException(Exception exception) {
+    private boolean displayException(Throwable exception) {
+        Throwable rootCause = exception;
+        while (rootCause instanceof EvalException) {
+            rootCause = rootCause.getCause();
+        }
+        if (rootCause != exception && rootCause instanceof UnresolvedReferenceException) {
+            // An unresolved reference caused a chained exception, just show the unresolved
+            return displayException(rootCause, null);
+        } else {
+            return displayException(exception, null);
+        }
+    }
+    //where
+    private boolean displayException(Throwable exception, StackTraceElement[] caused) {
         if (exception instanceof EvalException) {
-            printEvalException((EvalException) exception);
-            return true;
+            // User exception
+            return displayEvalException((EvalException) exception, caused);
         } else if (exception instanceof UnresolvedReferenceException) {
-            printUnresolvedException((UnresolvedReferenceException) exception);
-            return false;
+            // Reference to an undefined snippet
+            return displayUnresolvedException((UnresolvedReferenceException) exception);
         } else {
+            // Should never occur
             error("Unexpected execution exception: %s", exception);
             return true;
         }
     }
+    //where
+    private boolean displayUnresolvedException(UnresolvedReferenceException ex) {
+        // Display the resolution issue
+        printSnippetStatus(ex.getSnippet(), false);
+        return false;
+    }
+
+    //where
+    private boolean displayEvalException(EvalException ex, StackTraceElement[] caused) {
+        // The message for the user exception is configured based on the
+        // existance of an exception message and if this is a recursive
+        // invocation for a chained exception.
+        String msg = ex.getMessage();
+        String key = "jshell.err.exception" +
+                (caused == null? ".thrown" : ".cause") +
+                (msg == null? "" : ".message");
+        errormsg(key, ex.getExceptionClassName(), msg);
+        // The caused trace is sent to truncate duplicate elements in the cause trace
+        printStackTrace(ex.getStackTrace(), caused);
+        JShellException cause = ex.getCause();
+        if (cause != null) {
+            // Display the cause (recursively)
+            displayException(cause, ex.getStackTrace());
+        }
+        return true;
+    }
 
     /**
      * Display a list of diagnostics.
@@ -3518,9 +3559,19 @@
         }
         return false;
     }
-    //where
-    void printStackTrace(StackTraceElement[] stes) {
-        for (StackTraceElement ste : stes) {
+
+    // Print a stack trace, elide frames displayed for the caused exception
+    void printStackTrace(StackTraceElement[] stes, StackTraceElement[] caused) {
+        int overlap = 0;
+        if (caused != null) {
+            int maxOverlap = Math.min(stes.length, caused.length);
+            while (overlap < maxOverlap
+                    && stes[stes.length - (overlap + 1)].equals(caused[caused.length - (overlap + 1)])) {
+                ++overlap;
+            }
+        }
+        for (int i = 0; i < stes.length - overlap; ++i) {
+            StackTraceElement ste = stes[i];
             StringBuilder sb = new StringBuilder();
             String cn = ste.getClassName();
             if (!cn.isEmpty()) {
@@ -3548,19 +3599,9 @@
             error("      at %s(%s)", sb, loc);
 
         }
-    }
-    //where
-    void printUnresolvedException(UnresolvedReferenceException ex) {
-        printSnippetStatus(ex.getSnippet(), false);
-    }
-    //where
-    void printEvalException(EvalException ex) {
-        if (ex.getMessage() == null) {
-            error("%s thrown", ex.getExceptionClassName());
-        } else {
-            error("%s thrown: %s", ex.getExceptionClassName(), ex.getMessage());
+        if (overlap != 0) {
+            error("      ...");
         }
-        printStackTrace(ex.getStackTrace());
     }
 
     private FormatAction toAction(Status status, Status previousStatus, boolean isSignatureChange) {
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties	Wed Apr 04 14:32:05 2018 +0530
@@ -163,6 +163,11 @@
 
 jshell.err.corrupted.stored.startup = Corrupted stored startup, using default -- {0}
 
+jshell.err.exception.thrown = Exception {0}
+jshell.err.exception.thrown.message = Exception {0}: {1}
+jshell.err.exception.cause = Caused by: {0}
+jshell.err.exception.cause.message = Caused by: {0}: {1}
+
 jshell.console.see.synopsis = <press tab again to see synopsis>
 jshell.console.see.full.documentation = <press tab again to see full documentation>
 jshell.console.see.documentation = <press tab again to see documentation>
--- a/src/jdk.jshell/share/classes/jdk/jshell/Eval.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/jshell/Eval.java	Wed Apr 04 14:32:05 2018 +0530
@@ -850,17 +850,15 @@
                             ? expunge(value)
                             : "";
                 } catch (ResolutionException ex) {
-                    DeclarationSnippet sn = (DeclarationSnippet) state.maps.getSnippetDeadOrAlive(ex.id());
-                    exception = new UnresolvedReferenceException(sn, translateExceptionStack(ex));
+                    exception = asUnresolvedReferenceException(ex);
                 } catch (UserException ex) {
-                    exception = new EvalException(ex.getMessage(),
-                            ex.causeExceptionClass(),
-                            translateExceptionStack(ex));
+                    exception = asEvalException(ex);
                 } catch (RunException ex) {
                     // StopException - no-op
                 } catch (InternalException ex) {
                     state.debug(ex, "invoke");
                 } catch (EngineTerminationException ex) {
+                    state.debug(ex, "termination");
                     state.closeDown();
                 }
             } else if (si.subKind() == SubKind.VAR_DECLARATION_SUBKIND) {
@@ -890,6 +888,36 @@
         return events(c, outs, value, exception);
     }
 
+    // Convert an internal UserException to an API EvalException, translating
+    // the stack to snippet form.  Convert any chained exceptions
+    private EvalException asEvalException(UserException ue) {
+        return new EvalException(ue.getMessage(),
+                ue.causeExceptionClass(),
+                translateExceptionStack(ue),
+                asJShellException(ue.getCause()));
+    }
+
+    // Convert an internal ResolutionException to an API UnresolvedReferenceException,
+    // translating the snippet id to snipper and the stack to snippet form
+    private UnresolvedReferenceException asUnresolvedReferenceException(ResolutionException re) {
+        DeclarationSnippet sn = (DeclarationSnippet) state.maps.getSnippetDeadOrAlive(re.id());
+        return new UnresolvedReferenceException(sn, translateExceptionStack(re));
+    }
+
+    // Convert an internal UserException/ResolutionException to an API
+    // EvalException/UnresolvedReferenceException
+    private JShellException asJShellException(Throwable e) {
+        if (e == null) {
+            return null;
+        } else if (e instanceof UserException) {
+            return asEvalException((UserException) e);
+        } else if (e instanceof ResolutionException) {
+            return asUnresolvedReferenceException((ResolutionException) e);
+        } else {
+            throw new AssertionError(e);
+        }
+    }
+
     private boolean interestingEvent(SnippetEvent e) {
         return e.isSignatureChange()
                     || e.causeSnippet() == null
--- a/src/jdk.jshell/share/classes/jdk/jshell/EvalException.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/jshell/EvalException.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,10 @@
 package jdk.jshell;
 
 /**
- * Wraps an exception thrown in the remotely executing client.
+ * Wraps an throwable thrown in the executing client.
  * An instance of <code>EvalException</code> can be returned in the
  * {@link jdk.jshell.SnippetEvent#exception()} query.
- * The name of the exception thrown is available from
+ * The name of the throwable thrown is available from
  * {@link jdk.jshell.EvalException#getExceptionClassName()}.
  * Message and stack can be queried by methods on <code>Exception</code>.
  * <p>
@@ -45,8 +45,9 @@
 public class EvalException extends JShellException {
     private final String exceptionClass;
 
-    EvalException(String message, String exceptionClass, StackTraceElement[] stackElements) {
-        super(message);
+    EvalException(String message, String exceptionClass,
+            StackTraceElement[] stackElements, JShellException cause) {
+        super(message, cause);
         this.exceptionClass = exceptionClass;
         this.setStackTrace(stackElements);
     }
@@ -63,4 +64,18 @@
         return exceptionClass;
     }
 
+    /**
+     * Returns the wrapped cause of the throwable in the executing client
+     * represented by this {@code EvalException} or {@code null} if the cause is
+     * nonexistent or unknown.
+     *
+     * @return the cause wrapped in a {@code EvalException} or
+     * {@link UnresolvedReferenceException} or return {@code null} if the cause
+     * is nonexistent or unknown.
+     * @since 11
+     */
+    @Override
+    public JShellException getCause() {
+        return (JShellException) super.getCause();
+    }
 }
--- a/src/jdk.jshell/share/classes/jdk/jshell/JShellException.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/jshell/JShellException.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,4 +36,8 @@
     JShellException(String message) {
         super(message);
     }
+
+    JShellException(String message, Throwable cause) {
+        super(message, cause);
+    }
 }
--- a/src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java	Wed Apr 04 14:32:05 2018 +0530
@@ -167,7 +167,7 @@
         WrapSourceHandler sh = new WrapSourceHandler();
         List<String> allOptions = new ArrayList<>();
 
-        allOptions.add("--should-stop:at=FLOW");
+        allOptions.add("--should-stop=at=FLOW");
         allOptions.add("-Xlint:unchecked");
         allOptions.add("-proc:none");
         allOptions.addAll(extraArgs);
--- a/src/jdk.jshell/share/classes/jdk/jshell/UnresolvedReferenceException.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/jshell/UnresolvedReferenceException.java	Wed Apr 04 14:32:05 2018 +0530
@@ -45,7 +45,7 @@
     final DeclarationSnippet snippet;
 
     UnresolvedReferenceException(DeclarationSnippet snippet, StackTraceElement[] stackElements) {
-        super("Attempt to use definition snippet with unresolved references");
+        super("Attempt to use definition snippet with unresolved references in " + snippet);
         this.snippet = snippet;
         this.setStackTrace(stackElements);
     }
--- a/src/jdk.jshell/share/classes/jdk/jshell/execution/DirectExecutionControl.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/jshell/execution/DirectExecutionControl.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -288,11 +288,20 @@
      * @throws ExecutionControl.InternalException for internal problems
      */
     protected String throwConvertedInvocationException(Throwable cause) throws RunException, InternalException {
-        if (cause instanceof SPIResolutionException) {
-            SPIResolutionException spire = (SPIResolutionException) cause;
-            throw new ResolutionException(spire.id(), spire.getStackTrace());
+        throw asRunException(cause);
+    }
+
+    private RunException asRunException(Throwable ex) {
+        if (ex instanceof SPIResolutionException) {
+            SPIResolutionException spire = (SPIResolutionException) ex;
+            return new ResolutionException(spire.id(), spire.getStackTrace());
         } else {
-            throw new UserException(cause.getMessage(), cause.getClass().getName(), cause.getStackTrace());
+            UserException ue = new UserException(ex.getMessage(),
+                    ex.getClass().getName(),
+                    ex.getStackTrace());
+            Throwable cause = ex.getCause();
+            ue.initCause(cause == null ? null : asRunException(cause));
+            return ue;
         }
     }
 
--- a/src/jdk.jshell/share/classes/jdk/jshell/execution/ExecutionControlForwarder.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/jshell/execution/ExecutionControlForwarder.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -195,8 +195,7 @@
             flush();
             return true;
         } catch (InternalException ex) {
-            writeStatus(RESULT_INTERNAL_PROBLEM);
-            writeUTF(ex.getMessage());
+            writeInternalException(ex);
             flush();
             return true;
         } catch (ClassInstallException ex) {
@@ -206,16 +205,24 @@
             flush();
             return true;
         } catch (UserException ex) {
-            writeStatus(RESULT_USER_EXCEPTION);
-            writeNullOrUTF(ex.getMessage());
-            writeUTF(ex.causeExceptionClass());
-            writeObject(ex.getStackTrace());
+            writeStatus(RESULT_USER_EXCEPTION_CHAINED);
+            for (Throwable e = ex; e != null; ) {
+                if (e instanceof UserException) {
+                    writeUserException((UserException) e);
+                    e = e.getCause();
+                } else if (e instanceof ResolutionException) {
+                    writeResolutionException((ResolutionException) e);
+                    e = null;
+                } else {
+                    writeInternalException(e);
+                    e = null;
+                }
+            }
+            writeStatus(RESULT_SUCCESS);
             flush();
             return true;
         } catch (ResolutionException ex) {
-            writeStatus(RESULT_CORRALLED);
-            writeInt(ex.id());
-            writeObject(ex.getStackTrace());
+            writeResolutionException(ex);
             flush();
             return true;
         } catch (StoppedException ex) {
@@ -232,6 +239,24 @@
         }
     }
 
+    void writeInternalException(Throwable ex) throws IOException {
+        writeStatus(RESULT_INTERNAL_PROBLEM);
+        writeUTF(ex.getMessage());
+    }
+
+    void writeUserException(UserException ex) throws IOException {
+        writeStatus(RESULT_USER_EXCEPTION);
+        writeNullOrUTF(ex.getMessage());
+        writeUTF(ex.causeExceptionClass());
+        writeObject(ex.getStackTrace());
+    }
+
+    void writeResolutionException(ResolutionException ex) throws IOException {
+        writeStatus(RESULT_CORRALLED);
+        writeInt(ex.id());
+        writeObject(ex.getStackTrace());
+    }
+
     void commandLoop() {
         try {
             while (processCommand()) {
--- a/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteCodes.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteCodes.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -89,7 +89,7 @@
      */
     static final int RESULT_INTERNAL_PROBLEM        = 103;
     /**
-     * User exception encountered.
+     * User exception encountered. Legacy and used within RESULT_USER_EXCEPTION_CHAINED
      */
     static final int RESULT_USER_EXCEPTION          = 104;
     /**
@@ -104,5 +104,9 @@
      * The invoke has been stopped.
      */
     static final int RESULT_STOPPED                 = 107;
-
+    /**
+     * User exception encountered.
+     * @since 11
+     */
+    static final int RESULT_USER_EXCEPTION_CHAINED  = 108;
 }
--- a/src/jdk.jshell/share/classes/jdk/jshell/execution/StreamingExecutionControl.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/jshell/execution/StreamingExecutionControl.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -283,18 +283,46 @@
                     throw new NotImplementedException(message);
                 }
                 case RESULT_USER_EXCEPTION: {
-                    // A user exception was encountered.
-                    String message = readNullOrUTF();
-                    String exceptionClassName = in.readUTF();
-                    StackTraceElement[] elems = (StackTraceElement[]) in.readObject();
-                    throw new UserException(message, exceptionClassName, elems);
+                    // A user exception was encountered.  Handle pre JDK 11 back-ends
+                    throw readUserException();
                 }
                 case RESULT_CORRALLED: {
                     // An unresolved reference was encountered.
-                    int id = in.readInt();
-                    StackTraceElement[] elems = (StackTraceElement[]) in.readObject();
-                    ResolutionException re = new ResolutionException(id, elems);
-                    throw re;
+                    throw readResolutionException();
+                }
+                case RESULT_USER_EXCEPTION_CHAINED: {
+                    // A user exception was encountered -- transmit chained.
+                    in.readInt(); // always RESULT_USER_EXCEPTION
+                    UserException result = readUserException();
+                    RunException caused = result;
+                    // Loop through the chained causes (if any) building a chained exception
+                    loop: while (true) {
+                        RunException ex;
+                        int cstatus = in.readInt();
+                        switch (cstatus) {
+                            case RESULT_USER_EXCEPTION: {
+                                // A user exception was the proximal cause.
+                                ex = readUserException();
+                                break;
+                            }
+                            case RESULT_CORRALLED: {
+                                // An unresolved reference was the underlying cause.
+                                ex = readResolutionException();
+                                break;
+                            }
+                            case RESULT_SUCCESS: {
+                                // End of chained exceptions
+                                break loop;
+                            }
+                            default: {
+                                throw new EngineTerminationException("Bad chained remote result code: " + cstatus);
+                            }
+                        }
+                        caused.initCause(ex);
+                        caused = ex;
+                    }
+                    caused.initCause(null); // root cause has no cause
+                    throw result;
                 }
                 case RESULT_STOPPED: {
                     // Execution was aborted by the stop()
@@ -314,8 +342,21 @@
                 }
             }
         } catch (IOException | ClassNotFoundException ex) {
+            ex.printStackTrace();
             throw new EngineTerminationException(ex.toString());
         }
     }
 
+    private UserException readUserException() throws IOException, ClassNotFoundException {
+        String message = readNullOrUTF();
+        String exceptionClassName = in.readUTF();
+        StackTraceElement[] elems = (StackTraceElement[]) in.readObject();
+        return new UserException(message, exceptionClassName, elems);
+    }
+
+    private ResolutionException readResolutionException() throws IOException, ClassNotFoundException {
+        int id = in.readInt();
+        StackTraceElement[] elems = (StackTraceElement[]) in.readObject();
+        return new ResolutionException(id, elems);
+    }
 }
--- a/test/jdk/java/util/Optional/Basic.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/jdk/java/util/Optional/Basic.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,350 +22,182 @@
  */
 
 /* @test
+ * @bug 8195649
  * @summary Basic functional test of Optional
  * @author Mike Duigou
+ * @build ObscureException
  * @run testng Basic
  */
 
-import java.lang.AssertionError;
-import java.lang.NullPointerException;
-import java.lang.Throwable;
+import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Optional;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.stream.Stream;
+
+import static java.util.stream.Collectors.toList;
 
 import static org.testng.Assert.*;
 import org.testng.annotations.Test;
 
-
 public class Basic {
 
-    @Test(groups = "unit")
-    public void testEmpty() {
-        Optional<Boolean> empty = Optional.empty();
-        Optional<String> presentEmptyString = Optional.of("");
-        Optional<Boolean> present = Optional.of(Boolean.TRUE);
+    /**
+     * Checks a block of assertions over an empty Optional.
+     */
+    void checkEmpty(Optional<String> empty) {
+        assertTrue(empty.equals(Optional.empty()));
+        assertTrue(Optional.empty().equals(empty));
+        assertFalse(empty.equals(Optional.of("unexpected")));
+        assertFalse(Optional.of("unexpected").equals(empty));
+        assertFalse(empty.equals("unexpected"));
+
+        assertFalse(empty.isPresent());
+        assertEquals(empty.hashCode(), 0);
+        assertEquals(empty.orElse("x"), "x");
+        assertEquals(empty.orElseGet(() -> "y"), "y");
 
-        // empty
-        assertTrue(empty.equals(empty));
-        assertTrue(empty.equals(Optional.empty()));
-        assertTrue(!empty.equals(present));
-        assertTrue(0 == empty.hashCode());
-        assertTrue(!empty.toString().isEmpty());
-        assertTrue(!empty.toString().equals(presentEmptyString.toString()));
-        assertTrue(!empty.isPresent());
+        assertThrows(NoSuchElementException.class, () -> empty.get());
+        assertThrows(NoSuchElementException.class, () -> empty.orElseThrow());
+        assertThrows(ObscureException.class,       () -> empty.orElseThrow(ObscureException::new));
+
+        var b = new AtomicBoolean();
+        empty.ifPresent(s -> b.set(true));
+        assertFalse(b.get());
 
-        empty.ifPresent(v -> fail());
+        var b1 = new AtomicBoolean(false);
+        var b2 = new AtomicBoolean(false);
+        empty.ifPresentOrElse(s -> b1.set(true), () -> b2.set(true));
+        assertFalse(b1.get());
+        assertTrue(b2.get());
+
+        assertEquals(empty.toString(), "Optional.empty");
+    }
 
-        AtomicBoolean emptyCheck = new AtomicBoolean();
-        empty.ifPresentOrElse(v -> fail(), () -> emptyCheck.set(true));
-        assertTrue(emptyCheck.get());
+    /**
+     * Checks a block of assertions over an Optional that is expected to
+     * have a particular value present.
+     */
+    void checkPresent(Optional<String> opt, String expected) {
+        assertFalse(opt.equals(Optional.empty()));
+        assertFalse(Optional.empty().equals(opt));
+        assertTrue(opt.equals(Optional.of(expected)));
+        assertTrue(Optional.of(expected).equals(opt));
+        assertFalse(opt.equals(Optional.of("unexpected")));
+        assertFalse(Optional.of("unexpected").equals(opt));
+        assertFalse(opt.equals("unexpected"));
 
-        try {
-            empty.ifPresentOrElse(v -> fail(), () -> { throw new ObscureException(); });
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
+        assertTrue(opt.isPresent());
+        assertEquals(opt.hashCode(), expected.hashCode());
+        assertEquals(opt.orElse("unexpected"), expected);
+        assertEquals(opt.orElseGet(() -> "unexpected"), expected);
+
+        assertEquals(opt.get(), expected);
+        assertEquals(opt.orElseThrow(), expected);
+        assertEquals(opt.orElseThrow(ObscureException::new), expected);
 
-        assertSame(null, empty.orElse(null));
-        RuntimeException orElse = new RuntimeException() { };
-        assertSame(Boolean.FALSE, empty.orElse(Boolean.FALSE));
-        assertSame(null, empty.orElseGet(() -> null));
-        assertSame(Boolean.FALSE, empty.orElseGet(() -> Boolean.FALSE));
+        var b = new AtomicBoolean(false);
+        opt.ifPresent(s -> b.set(true));
+        assertTrue(b.get());
+
+        var b1 = new AtomicBoolean(false);
+        var b2 = new AtomicBoolean(false);
+        opt.ifPresentOrElse(s -> b1.set(true), () -> b2.set(true));
+        assertTrue(b1.get());
+        assertFalse(b2.get());
+
+        assertEquals(opt.toString(), "Optional[" + expected + "]");
     }
 
     @Test(groups = "unit")
-    public void testIfPresentAndOrElseAndNull() {
-        Optional<Boolean> empty = Optional.empty();
-        Optional<Boolean> present = Optional.of(Boolean.TRUE);
-
-        // No NPE
-        present.ifPresentOrElse(v -> {}, null);
-        empty.ifPresent(null);
-        empty.ifPresentOrElse(null, () -> {});
-
-        // NPE
-        try {
-            present.ifPresent(null);
-            fail();
-        } catch (NullPointerException ex) {}
-        try {
-            present.ifPresentOrElse(null, () -> {});
-            fail();
-        } catch (NullPointerException ex) {}
-        try {
-            empty.ifPresentOrElse(v -> {}, null);
-            fail();
-        } catch (NullPointerException ex) {}
-    }
-
-    @Test(expectedExceptions=NoSuchElementException.class)
-    public void testEmptyGet() {
-        Optional<Boolean> empty = Optional.empty();
-
-        Boolean got = empty.get();
-    }
-
-    @Test(expectedExceptions=NullPointerException.class)
-    public void testEmptyOrElseGetNull() {
-        Optional<Boolean> empty = Optional.empty();
-
-        Boolean got = empty.orElseGet(null);
-    }
-
-    @Test(expectedExceptions=NullPointerException.class)
-    public void testEmptyOrElseThrowNull() throws Throwable {
-        Optional<Boolean> empty = Optional.empty();
-
-        Boolean got = empty.orElseThrow(null);
-    }
-
-    @Test(expectedExceptions=ObscureException.class)
-    public void testEmptyOrElseThrow() throws Exception {
-        Optional<Boolean> empty = Optional.empty();
-
-        Boolean got = empty.orElseThrow(ObscureException::new);
-    }
-
-    @Test(expectedExceptions=NoSuchElementException.class)
-    public void testEmptyOrElseThrowNoArg() throws Exception {
-        Optional<Boolean> empty = Optional.empty();
-
-        Boolean got = empty.orElseThrow();
+    public void testEmpty() {
+        checkEmpty(Optional.empty());
     }
 
     @Test(groups = "unit")
-    public void testPresent() {
-        Optional<Boolean> empty = Optional.empty();
-        Optional<String> presentEmptyString = Optional.of("");
-        Optional<Boolean> present = Optional.of(Boolean.TRUE);
-
-        // present
-        assertTrue(present.equals(present));
-        assertTrue(present.equals(Optional.of(Boolean.TRUE)));
-        assertTrue(!present.equals(empty));
-        assertTrue(Boolean.TRUE.hashCode() == present.hashCode());
-        assertTrue(!present.toString().isEmpty());
-        assertTrue(!present.toString().equals(presentEmptyString.toString()));
-        assertTrue(-1 != present.toString().indexOf(Boolean.TRUE.toString()));
-        assertSame(Boolean.TRUE, present.get());
-        assertSame(Boolean.TRUE, present.orElseThrow());
-
-        AtomicBoolean presentCheck = new AtomicBoolean();
-        present.ifPresent(v -> presentCheck.set(true));
-        assertTrue(presentCheck.get());
-        presentCheck.set(false);
-        present.ifPresentOrElse(v -> presentCheck.set(true), () -> fail());
-        assertTrue(presentCheck.get());
-
-        try {
-            present.ifPresent(v -> { throw new ObscureException(); });
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
-        try {
-            present.ifPresentOrElse(v -> { throw new ObscureException(); }, () -> fail());
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
-
-        assertSame(Boolean.TRUE, present.orElse(null));
-        assertSame(Boolean.TRUE, present.orElse(Boolean.FALSE));
-        assertSame(Boolean.TRUE, present.orElseGet(null));
-        assertSame(Boolean.TRUE, present.orElseGet(() -> null));
-        assertSame(Boolean.TRUE, present.orElseGet(() -> Boolean.FALSE));
-        assertSame(Boolean.TRUE, present.<RuntimeException>orElseThrow(null));
-        assertSame(Boolean.TRUE, present.<RuntimeException>orElseThrow(ObscureException::new));
-    }
-
-    @Test(groups = "unit")
-    public void testOfNullable() {
-        Optional<String> instance = Optional.ofNullable(null);
-        assertFalse(instance.isPresent());
-
-        instance = Optional.ofNullable("Duke");
-        assertTrue(instance.isPresent());
-        assertEquals(instance.get(), "Duke");
-        assertEquals(instance.orElseThrow(), "Duke");
+    public void testOfNull() {
+        assertThrows(NullPointerException.class, () -> Optional.of(null));
     }
 
     @Test(groups = "unit")
-    public void testFilter() {
-        // Null mapper function
-        Optional<String> empty = Optional.empty();
-        Optional<String> duke = Optional.of("Duke");
-
-        try {
-            Optional<String> result = empty.filter(null);
-            fail("Should throw NPE on null mapping function");
-        } catch (NullPointerException npe) {
-            // expected
-        }
+    public void testOfPresent() {
+        checkPresent(Optional.of("xyzzy"), "xyzzy");
+    }
 
-        Optional<String> result = empty.filter(String::isEmpty);
-        assertFalse(result.isPresent());
+    @Test(groups = "unit")
+    public void testOfNullableNull() {
+        checkEmpty(Optional.ofNullable(null));
+    }
 
-        result = duke.filter(String::isEmpty);
-        assertFalse(result.isPresent());
-        result = duke.filter(s -> s.startsWith("D"));
-        assertTrue(result.isPresent());
-        assertEquals(result.get(), "Duke");
-        assertEquals(result.orElseThrow(), "Duke");
-
-        Optional<String> emptyString = Optional.of("");
-        result = emptyString.filter(String::isEmpty);
-        assertTrue(result.isPresent());
-        assertEquals(result.get(), "");
-        assertEquals(result.orElseThrow(), "");
+    @Test(groups = "unit")
+    public void testOfNullablePresent() {
+        checkPresent(Optional.ofNullable("xyzzy"), "xyzzy");
     }
 
     @Test(groups = "unit")
-    public void testMap() {
-        Optional<String> empty = Optional.empty();
-        Optional<String> duke = Optional.of("Duke");
+    public void testFilterEmpty() {
+        checkEmpty(Optional.<String>empty().filter(s -> { fail(); return true; }));
+    }
 
-        // Null mapper function
-        try {
-            Optional<Boolean> b = empty.map(null);
-            fail("Should throw NPE on null mapping function");
-        } catch (NullPointerException npe) {
-            // expected
-        }
+    @Test(groups = "unit")
+    public void testFilterFalse() {
+        checkEmpty(Optional.of("xyzzy").filter(s -> s.equals("plugh")));
+    }
 
-        // Map an empty value
-        Optional<Boolean> b = empty.map(String::isEmpty);
-        assertFalse(b.isPresent());
+    @Test(groups = "unit")
+    public void testFilterTrue() {
+        checkPresent(Optional.of("xyzzy").filter(s -> s.equals("xyzzy")), "xyzzy");
+    }
 
-        // Map into null
-        b = empty.map(n -> null);
-        assertFalse(b.isPresent());
-        b = duke.map(s -> null);
-        assertFalse(b.isPresent());
+    @Test(groups = "unit")
+    public void testMapEmpty() {
+        checkEmpty(Optional.empty().map(s -> { fail(); return ""; }));
+    }
 
-        // Map to value
-        Optional<Integer> l = duke.map(String::length);
-        assertEquals(l.get().intValue(), 4);
+    @Test(groups = "unit")
+    public void testMapPresent() {
+        checkPresent(Optional.of("xyzzy").map(s -> s.replace("xyzzy", "plugh")), "plugh");
     }
 
     @Test(groups = "unit")
-    public void testFlatMap() {
-        Optional<String> empty = Optional.empty();
-        Optional<String> duke = Optional.of("Duke");
-
-        // Null mapper function
-        try {
-            Optional<Boolean> b = empty.flatMap(null);
-            fail("Should throw NPE on null mapping function");
-        } catch (NullPointerException npe) {
-            // expected
-        }
-
-        // Map into null
-        try {
-            Optional<Boolean> b = duke.flatMap(s -> null);
-            fail("Should throw NPE when mapper return null");
-        } catch (NullPointerException npe) {
-            // expected
-        }
+    public void testFlatMapEmpty() {
+        checkEmpty(Optional.empty().flatMap(s -> { fail(); return Optional.of(""); }));
+    }
 
-        // Empty won't invoke mapper function
-        try {
-            Optional<Boolean> b = empty.flatMap(s -> null);
-            assertFalse(b.isPresent());
-        } catch (NullPointerException npe) {
-            fail("Mapper function should not be invoked");
-        }
+    @Test(groups = "unit")
+    public void testFlatMapPresentReturnEmpty() {
+        checkEmpty(Optional.of("xyzzy")
+                           .flatMap(s -> { assertEquals(s, "xyzzy"); return Optional.empty(); }));
+    }
 
-        // Map an empty value
-        Optional<Integer> l = empty.flatMap(s -> Optional.of(s.length()));
-        assertFalse(l.isPresent());
-
-        // Map to value
-        Optional<Integer> fixture = Optional.of(Integer.MAX_VALUE);
-        l = duke.flatMap(s -> Optional.of(s.length()));
-        assertTrue(l.isPresent());
-        assertEquals(l.get().intValue(), 4);
-        assertEquals(l.orElseThrow().intValue(), 4);
-
-        // Verify same instance
-        l = duke.flatMap(s -> fixture);
-        assertSame(l, fixture);
+    @Test(groups = "unit")
+    public void testFlatMapPresentReturnPresent() {
+        checkPresent(Optional.of("xyzzy")
+                             .flatMap(s -> { assertEquals(s, "xyzzy"); return Optional.of("plugh"); }),
+                     "plugh");
     }
 
     @Test(groups = "unit")
-    public void testOr() {
-        Optional<String> empty = Optional.empty();
-        Optional<String> duke = Optional.of("Duke");
-
-        // Null supplier
-        try {
-            Optional<String> b = empty.or(null);
-            fail("Should throw NPE on null supplier");
-        } catch (NullPointerException npe) {
-            // expected
-        }
+    public void testOrEmptyEmpty() {
+        checkEmpty(Optional.<String>empty().or(() -> Optional.empty()));
+    }
 
-        // Supply null
-        try {
-            Optional<String> b = empty.or(() -> null);
-            fail("Should throw NPE when supplier returns null");
-        } catch (NullPointerException npe) {
-            // expected
-        }
-
-        // Non-empty won't invoke supplier
-        try {
-            Optional<String> b = duke.or(() -> null);
-            assertTrue(b.isPresent());
-        } catch (NullPointerException npe) {
-            fail("Supplier should not be invoked");
-        }
-
-        // Supply for empty
-        Optional<String> suppliedDuke = empty.or(() -> duke);
-        assertTrue(suppliedDuke.isPresent());
-        assertSame(suppliedDuke, duke);
-
-        // Supply for non-empty
-        Optional<String> actualDuke = duke.or(() -> Optional.of("Other Duke"));
-        assertTrue(actualDuke.isPresent());
-        assertSame(actualDuke, duke);
+    @Test(groups = "unit")
+    public void testOrEmptyPresent() {
+        checkPresent(Optional.<String>empty().or(() -> Optional.of("plugh")), "plugh");
     }
 
     @Test(groups = "unit")
-    public void testStream() {
-        {
-            Stream<String> s = Optional.<String>empty().stream();
-            assertFalse(s.isParallel());
-
-            Object[] es = s.toArray();
-            assertEquals(es.length, 0);
-        }
-
-        {
-            Stream<String> s = Optional.of("Duke").stream();
-            assertFalse(s.isParallel());
-
-            String[] es = s.toArray(String[]::new);
-            assertEquals(es.length, 1);
-            assertEquals(es[0], "Duke");
-        }
+    public void testOrPresentDontCare() {
+        checkPresent(Optional.of("xyzzy").or(() -> { fail(); return Optional.of("plugh"); }), "xyzzy");
     }
 
-    private static class ObscureException extends RuntimeException {
+    @Test(groups = "unit")
+    public void testStreamEmpty() {
+        assertEquals(Optional.empty().stream().collect(toList()), List.of());
+    }
 
+    @Test(groups = "unit")
+    public void testStreamPresent() {
+        assertEquals(Optional.of("xyzzy").stream().collect(toList()), List.of("xyzzy"));
     }
 }
--- a/test/jdk/java/util/Optional/BasicDouble.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/jdk/java/util/Optional/BasicDouble.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,187 +22,108 @@
  */
 
 /* @test
+ * @bug 8195649
  * @summary Basic functional test of OptionalDouble
  * @author Mike Duigou
+ * @build ObscureException
  * @run testng BasicDouble
  */
 
 import java.util.NoSuchElementException;
 import java.util.OptionalDouble;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.stream.DoubleStream;
 
 import static org.testng.Assert.*;
 import org.testng.annotations.Test;
 
-
 public class BasicDouble {
+    static final double DOUBLEVAL = Math.PI;
+    static final double UNEXPECTED = 6.62607004E-34;
 
-    @Test(groups = "unit")
-    public void testEmpty() {
-        OptionalDouble empty = OptionalDouble.empty();
-        OptionalDouble present = OptionalDouble.of(1.0);
+    /**
+     * Checks a block of assertions over an empty OptionalDouble.
+     */
+    void checkEmpty(OptionalDouble empty) {
+        assertTrue(empty.equals(OptionalDouble.empty()));
+        assertTrue(OptionalDouble.empty().equals(empty));
+        assertFalse(empty.equals(OptionalDouble.of(UNEXPECTED)));
+        assertFalse(OptionalDouble.of(UNEXPECTED).equals(empty));
+        assertFalse(empty.equals("unexpected"));
 
-        // empty
-        assertTrue(empty.equals(empty));
-        assertTrue(empty.equals(OptionalDouble.empty()));
-        assertTrue(!empty.equals(present));
-        assertTrue(0 == empty.hashCode());
-        assertTrue(!empty.toString().isEmpty());
-        assertTrue(!empty.isPresent());
+        assertFalse(empty.isPresent());
+        assertEquals(empty.hashCode(), 0);
+        assertEquals(empty.orElse(UNEXPECTED), UNEXPECTED);
+        assertEquals(empty.orElseGet(() -> UNEXPECTED), UNEXPECTED);
+
+        assertThrows(NoSuchElementException.class, () -> empty.getAsDouble());
+        assertThrows(NoSuchElementException.class, () -> empty.orElseThrow());
+        assertThrows(ObscureException.class,       () -> empty.orElseThrow(ObscureException::new));
+
+        var b = new AtomicBoolean();
+        empty.ifPresent(s -> b.set(true));
+        assertFalse(b.get());
+
+        var b1 = new AtomicBoolean(false);
+        var b2 = new AtomicBoolean(false);
+        empty.ifPresentOrElse(s -> b1.set(true), () -> b2.set(true));
+        assertFalse(b1.get());
+        assertTrue(b2.get());
 
-        empty.ifPresent(v -> { fail(); });
+        assertEquals(empty.toString(), "OptionalDouble.empty");
+    }
 
-        AtomicBoolean emptyCheck = new AtomicBoolean();
-        empty.ifPresentOrElse(v -> fail(), () -> emptyCheck.set(true));
-        assertTrue(emptyCheck.get());
+    /**
+     * Checks a block of assertions over an OptionalDouble that is expected to
+     * have a particular value present.
+     */
+    void checkPresent(OptionalDouble opt, double expected) {
+        assertFalse(opt.equals(OptionalDouble.empty()));
+        assertFalse(OptionalDouble.empty().equals(opt));
+        assertTrue(opt.equals(OptionalDouble.of(expected)));
+        assertTrue(OptionalDouble.of(expected).equals(opt));
+        assertFalse(opt.equals(OptionalDouble.of(UNEXPECTED)));
+        assertFalse(OptionalDouble.of(UNEXPECTED).equals(opt));
+        assertFalse(opt.equals("unexpected"));
 
-        try {
-            empty.ifPresentOrElse(v -> fail(), () -> { throw new ObscureException(); });
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
+        assertTrue(opt.isPresent());
+        assertEquals(opt.hashCode(), Double.hashCode(expected));
+        assertEquals(opt.orElse(UNEXPECTED), expected);
+        assertEquals(opt.orElseGet(() -> UNEXPECTED), expected);
+
+        assertEquals(opt.getAsDouble(), expected);
+        assertEquals(opt.orElseThrow(), expected);
+        assertEquals(opt.orElseThrow(ObscureException::new), expected);
 
-        assertEquals(2.0, empty.orElse(2.0));
-        assertEquals(2.0, empty.orElseGet(()-> 2.0));
+        var b = new AtomicBoolean(false);
+        opt.ifPresent(s -> b.set(true));
+        assertTrue(b.get());
+
+        var b1 = new AtomicBoolean(false);
+        var b2 = new AtomicBoolean(false);
+        opt.ifPresentOrElse(s -> b1.set(true), () -> b2.set(true));
+        assertTrue(b1.get());
+        assertFalse(b2.get());
+
+        assertEquals(opt.toString(), "OptionalDouble[" + expected + "]");
     }
 
     @Test(groups = "unit")
-    public void testIfPresentAndOrElseAndNull() {
-        OptionalDouble empty = OptionalDouble.empty();
-        OptionalDouble present = OptionalDouble.of(1.0);
-
-        // No NPE
-        present.ifPresentOrElse(v -> {}, null);
-        empty.ifPresent(null);
-        empty.ifPresentOrElse(null, () -> {});
-
-        // NPE
-        try {
-            present.ifPresent(null);
-            fail();
-        } catch (NullPointerException ex) {}
-        try {
-            present.ifPresentOrElse(null, () -> {});
-            fail();
-        } catch (NullPointerException ex) {}
-        try {
-            empty.ifPresentOrElse(v -> {}, null);
-            fail();
-        } catch (NullPointerException ex) {}
-    }
-
-    @Test(expectedExceptions=NoSuchElementException.class)
-    public void testEmptyGet() {
-        OptionalDouble empty = OptionalDouble.empty();
-
-        double got = empty.getAsDouble();
-    }
-
-    @Test(expectedExceptions=NullPointerException.class)
-    public void testEmptyOrElseGetNull() {
-        OptionalDouble empty = OptionalDouble.empty();
-
-        double got = empty.orElseGet(null);
-    }
-
-    @Test(expectedExceptions=NullPointerException.class)
-    public void testEmptyOrElseThrowNull() throws Throwable {
-        OptionalDouble empty = OptionalDouble.empty();
-
-        double got = empty.orElseThrow(null);
-    }
-
-    @Test(expectedExceptions=ObscureException.class)
-    public void testEmptyOrElseThrow() throws Exception {
-        OptionalDouble empty = OptionalDouble.empty();
-
-        double got = empty.orElseThrow(ObscureException::new);
-    }
-
-    @Test(expectedExceptions=NoSuchElementException.class)
-    public void testEmptyOrElseThrowNoArg() throws Exception {
-        OptionalDouble empty = OptionalDouble.empty();
-
-        double got = empty.orElseThrow();
+    public void testEmpty() {
+        checkEmpty(OptionalDouble.empty());
     }
 
     @Test(groups = "unit")
     public void testPresent() {
-        OptionalDouble empty = OptionalDouble.empty();
-        OptionalDouble present = OptionalDouble.of(1.0);
-
-        // present
-        assertTrue(present.equals(present));
-        assertFalse(present.equals(OptionalDouble.of(0.0)));
-        assertTrue(present.equals(OptionalDouble.of(1.0)));
-        assertTrue(!present.equals(empty));
-        assertTrue(Double.hashCode(1.0) == present.hashCode());
-        assertFalse(present.toString().isEmpty());
-        assertTrue(-1 != present.toString().indexOf(Double.toString(present.getAsDouble()).toString()));
-        assertTrue(-1 != present.toString().indexOf(Double.toString(present.orElseThrow()).toString()));
-        assertEquals(1.0, present.getAsDouble());
-        assertEquals(1.0, present.orElseThrow());
-
-        AtomicBoolean presentCheck = new AtomicBoolean();
-        present.ifPresent(v -> presentCheck.set(true));
-        assertTrue(presentCheck.get());
-        presentCheck.set(false);
-        present.ifPresentOrElse(v -> presentCheck.set(true), () -> fail());
-        assertTrue(presentCheck.get());
-
-        try {
-            present.ifPresent(v -> { throw new ObscureException(); });
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
-        try {
-            present.ifPresentOrElse(v -> { throw new ObscureException(); }, () -> fail());
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
-
-        assertEquals(1.0, present.orElse(2.0));
-        assertEquals(1.0, present.orElseGet(null));
-        assertEquals(1.0, present.orElseGet(()-> 2.0));
-        assertEquals(1.0, present.orElseGet(()-> 3.0));
-        assertEquals(1.0, present.<RuntimeException>orElseThrow(null));
-        assertEquals(1.0, present.<RuntimeException>orElseThrow(ObscureException::new));
+        checkPresent(OptionalDouble.of(DOUBLEVAL), DOUBLEVAL);
     }
 
     @Test(groups = "unit")
-    public void testStream() {
-        {
-            DoubleStream s = OptionalDouble.empty().stream();
-            assertFalse(s.isParallel());
-
-            double[] es = s.toArray();
-            assertEquals(es.length, 0);
-        }
-
-        {
-            DoubleStream s = OptionalDouble.of(42.0).stream();
-            assertFalse(s.isParallel());
-
-            double[] es = s.toArray();
-            assertEquals(es.length, 1);
-            assertEquals(es[0], 42.0);
-        }
+    public void testStreamEmpty() {
+        assertEquals(OptionalDouble.empty().stream().toArray(), new double[] { });
     }
 
-    private static class ObscureException extends RuntimeException {
-
+    @Test(groups = "unit")
+    public void testStreamPresent() {
+        assertEquals(OptionalDouble.of(DOUBLEVAL).stream().toArray(), new double[] { DOUBLEVAL });
     }
 }
--- a/test/jdk/java/util/Optional/BasicInt.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/jdk/java/util/Optional/BasicInt.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,187 +22,109 @@
  */
 
 /* @test
+ * @bug 8195649
  * @summary Basic functional test of OptionalInt
  * @author Mike Duigou
+ * @build ObscureException
  * @run testng BasicInt
  */
 
 import java.util.NoSuchElementException;
 import java.util.OptionalInt;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.stream.IntStream;
 
 import static org.testng.Assert.*;
 import org.testng.annotations.Test;
 
-
 public class BasicInt {
 
-    @Test(groups = "unit")
-    public void testEmpty() {
-        OptionalInt empty = OptionalInt.empty();
-        OptionalInt present = OptionalInt.of(1);
+    static final int INTVAL = 33_550_336;
+    static final int UNEXPECTED = 0xCAFEBABE;
+
+    /**
+     * Checks a block of assertions over an empty OptionalInt.
+     */
+    void checkEmpty(OptionalInt empty) {
+        assertTrue(empty.equals(OptionalInt.empty()));
+        assertTrue(OptionalInt.empty().equals(empty));
+        assertFalse(empty.equals(OptionalInt.of(UNEXPECTED)));
+        assertFalse(OptionalInt.of(UNEXPECTED).equals(empty));
+        assertFalse(empty.equals("unexpected"));
 
-        // empty
-        assertTrue(empty.equals(empty));
-        assertTrue(empty.equals(OptionalInt.empty()));
-        assertTrue(!empty.equals(present));
-        assertTrue(0 == empty.hashCode());
-        assertTrue(!empty.toString().isEmpty());
-        assertTrue(!empty.isPresent());
+        assertFalse(empty.isPresent());
+        assertEquals(empty.hashCode(), 0);
+        assertEquals(empty.orElse(UNEXPECTED), UNEXPECTED);
+        assertEquals(empty.orElseGet(() -> UNEXPECTED), UNEXPECTED);
+
+        assertThrows(NoSuchElementException.class, () -> empty.getAsInt());
+        assertThrows(NoSuchElementException.class, () -> empty.orElseThrow());
+        assertThrows(ObscureException.class,       () -> empty.orElseThrow(ObscureException::new));
 
-        empty.ifPresent(v -> { fail(); });
+        var b = new AtomicBoolean();
+        empty.ifPresent(s -> b.set(true));
+        assertFalse(b.get());
+
+        var b1 = new AtomicBoolean(false);
+        var b2 = new AtomicBoolean(false);
+        empty.ifPresentOrElse(s -> b1.set(true), () -> b2.set(true));
+        assertFalse(b1.get());
+        assertTrue(b2.get());
 
-        AtomicBoolean emptyCheck = new AtomicBoolean();
-        empty.ifPresentOrElse(v -> fail(), () -> emptyCheck.set(true));
-        assertTrue(emptyCheck.get());
+        assertEquals(empty.toString(), "OptionalInt.empty");
+    }
+
+    /**
+     * Checks a block of assertions over an OptionalInt that is expected to
+     * have a particular value present.
+     */
+    void checkPresent(OptionalInt opt, int expected) {
+        assertFalse(opt.equals(OptionalInt.empty()));
+        assertFalse(OptionalInt.empty().equals(opt));
+        assertTrue(opt.equals(OptionalInt.of(expected)));
+        assertTrue(OptionalInt.of(expected).equals(opt));
+        assertFalse(opt.equals(OptionalInt.of(UNEXPECTED)));
+        assertFalse(OptionalInt.of(UNEXPECTED).equals(opt));
+        assertFalse(opt.equals("unexpected"));
 
-        try {
-            empty.ifPresentOrElse(v -> fail(), () -> { throw new ObscureException(); });
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
+        assertTrue(opt.isPresent());
+        assertEquals(opt.hashCode(), Integer.hashCode(expected));
+        assertEquals(opt.orElse(UNEXPECTED), expected);
+        assertEquals(opt.orElseGet(() -> UNEXPECTED), expected);
+
+        assertEquals(opt.getAsInt(), expected);
+        assertEquals(opt.orElseThrow(), expected);
+        assertEquals(opt.orElseThrow(ObscureException::new), expected);
 
-        assertEquals(2, empty.orElse(2));
-        assertEquals(2, empty.orElseGet(()-> 2));
+        var b = new AtomicBoolean(false);
+        opt.ifPresent(s -> b.set(true));
+        assertTrue(b.get());
+
+        var b1 = new AtomicBoolean(false);
+        var b2 = new AtomicBoolean(false);
+        opt.ifPresentOrElse(s -> b1.set(true), () -> b2.set(true));
+        assertTrue(b1.get());
+        assertFalse(b2.get());
+
+        assertEquals(opt.toString(), "OptionalInt[" + expected + "]");
     }
 
     @Test(groups = "unit")
-    public void testIfPresentAndOrElseAndNull() {
-        OptionalInt empty = OptionalInt.empty();
-        OptionalInt present = OptionalInt.of(1);
-
-        // No NPE
-        present.ifPresentOrElse(v -> {}, null);
-        empty.ifPresent(null);
-        empty.ifPresentOrElse(null, () -> {});
-
-        // NPE
-        try {
-            present.ifPresent(null);
-            fail();
-        } catch (NullPointerException ex) {}
-        try {
-            present.ifPresentOrElse(null, () -> {});
-            fail();
-        } catch (NullPointerException ex) {}
-        try {
-            empty.ifPresentOrElse(v -> {}, null);
-            fail();
-        } catch (NullPointerException ex) {}
-    }
-
-    @Test(expectedExceptions=NoSuchElementException.class)
-    public void testEmptyGet() {
-        OptionalInt empty = OptionalInt.empty();
-
-        int got = empty.getAsInt();
-    }
-
-    @Test(expectedExceptions=NullPointerException.class)
-    public void testEmptyOrElseGetNull() {
-        OptionalInt empty = OptionalInt.empty();
-
-        int got = empty.orElseGet(null);
-    }
-
-    @Test(expectedExceptions=NullPointerException.class)
-    public void testEmptyOrElseThrowNull() throws Throwable {
-        OptionalInt empty = OptionalInt.empty();
-
-        int got = empty.orElseThrow(null);
-    }
-
-    @Test(expectedExceptions=ObscureException.class)
-    public void testEmptyOrElseThrow() throws Exception {
-        OptionalInt empty = OptionalInt.empty();
-
-        int got = empty.orElseThrow(ObscureException::new);
-    }
-
-    @Test(expectedExceptions=NoSuchElementException.class)
-    public void testEmptyOrElseThrowNoArg() throws Exception {
-        OptionalInt empty = OptionalInt.empty();
-
-        int got = empty.orElseThrow();
+    public void testEmpty() {
+        checkEmpty(OptionalInt.empty());
     }
 
     @Test(groups = "unit")
     public void testPresent() {
-        OptionalInt empty = OptionalInt.empty();
-        OptionalInt present = OptionalInt.of(1);
-
-        // present
-        assertTrue(present.equals(present));
-        assertFalse(present.equals(OptionalInt.of(0)));
-        assertTrue(present.equals(OptionalInt.of(1)));
-        assertFalse(present.equals(empty));
-        assertTrue(Integer.hashCode(1) == present.hashCode());
-        assertFalse(present.toString().isEmpty());
-        assertTrue(-1 != present.toString().indexOf(Integer.toString(present.getAsInt()).toString()));
-        assertTrue(-1 != present.toString().indexOf(Integer.toString(present.orElseThrow()).toString()));
-        assertEquals(1, present.getAsInt());
-        assertEquals(1, present.orElseThrow());
-
-        AtomicBoolean presentCheck = new AtomicBoolean();
-        present.ifPresent(v -> presentCheck.set(true));
-        assertTrue(presentCheck.get());
-        presentCheck.set(false);
-        present.ifPresentOrElse(v -> presentCheck.set(true), () -> fail());
-        assertTrue(presentCheck.get());
-
-        try {
-            present.ifPresent(v -> { throw new ObscureException(); });
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
-        try {
-            present.ifPresentOrElse(v -> { throw new ObscureException(); }, () -> fail());
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
-
-        assertEquals(1, present.orElse(2));
-        assertEquals(1, present.orElseGet(null));
-        assertEquals(1, present.orElseGet(()-> 2));
-        assertEquals(1, present.orElseGet(()-> 3));
-        assertEquals(1, present.<RuntimeException>orElseThrow(null));
-        assertEquals(1, present.<RuntimeException>orElseThrow(ObscureException::new));
+        checkPresent(OptionalInt.of(INTVAL), INTVAL);
     }
 
     @Test(groups = "unit")
-    public void testStream() {
-        {
-            IntStream s = OptionalInt.empty().stream();
-            assertFalse(s.isParallel());
-
-            int[] es = s.toArray();
-            assertEquals(es.length, 0);
-        }
-
-        {
-            IntStream s = OptionalInt.of(42).stream();
-            assertFalse(s.isParallel());
-
-            int[] es = OptionalInt.of(42).stream().toArray();
-            assertEquals(es.length, 1);
-            assertEquals(es[0], 42);
-        }
+    public void testStreamEmpty() {
+        assertEquals(OptionalInt.empty().stream().toArray(), new int[] { });
     }
 
-    private static class ObscureException extends RuntimeException {
-
+    @Test(groups = "unit")
+    public void testStreamPresent() {
+        assertEquals(OptionalInt.of(INTVAL).stream().toArray(), new int[] { INTVAL });
     }
 }
--- a/test/jdk/java/util/Optional/BasicLong.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/jdk/java/util/Optional/BasicLong.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,187 +22,108 @@
  */
 
 /* @test
+ * @bug 8195649
  * @summary Basic functional test of OptionalLong
  * @author Mike Duigou
+ * @build ObscureException
  * @run testng BasicLong
  */
 
 import java.util.NoSuchElementException;
 import java.util.OptionalLong;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.stream.LongStream;
 
 import static org.testng.Assert.*;
 import org.testng.annotations.Test;
 
-
 public class BasicLong {
+    static final long LONGVAL = 2_305_843_008_139_952_128L;
+    static final long UNEXPECTED = 0xFEEDBEEFCAFEBABEL;
 
-    @Test(groups = "unit")
-    public void testEmpty() {
-        OptionalLong empty = OptionalLong.empty();
-        OptionalLong present = OptionalLong.of(1);
+    /**
+     * Checks a block of assertions over an empty OptionalLong.
+     */
+    void checkEmpty(OptionalLong empty) {
+        assertTrue(empty.equals(OptionalLong.empty()));
+        assertTrue(OptionalLong.empty().equals(empty));
+        assertFalse(empty.equals(OptionalLong.of(UNEXPECTED)));
+        assertFalse(OptionalLong.of(UNEXPECTED).equals(empty));
+        assertFalse(empty.equals("unexpected"));
 
-        // empty
-        assertTrue(empty.equals(empty));
-        assertTrue(empty.equals(OptionalLong.empty()));
-        assertTrue(!empty.equals(present));
-        assertTrue(0 == empty.hashCode());
-        assertTrue(!empty.toString().isEmpty());
-        assertTrue(!empty.isPresent());
+        assertFalse(empty.isPresent());
+        assertEquals(empty.hashCode(), 0);
+        assertEquals(empty.orElse(UNEXPECTED), UNEXPECTED);
+        assertEquals(empty.orElseGet(() -> UNEXPECTED), UNEXPECTED);
+
+        assertThrows(NoSuchElementException.class, () -> empty.getAsLong());
+        assertThrows(NoSuchElementException.class, () -> empty.orElseThrow());
+        assertThrows(ObscureException.class,       () -> empty.orElseThrow(ObscureException::new));
+
+        var b = new AtomicBoolean();
+        empty.ifPresent(s -> b.set(true));
+        assertFalse(b.get());
+
+        var b1 = new AtomicBoolean(false);
+        var b2 = new AtomicBoolean(false);
+        empty.ifPresentOrElse(s -> b1.set(true), () -> b2.set(true));
+        assertFalse(b1.get());
+        assertTrue(b2.get());
 
-        empty.ifPresent(v -> { fail(); });
+        assertEquals(empty.toString(), "OptionalLong.empty");
+    }
 
-        AtomicBoolean emptyCheck = new AtomicBoolean();
-        empty.ifPresentOrElse(v -> fail(), () -> emptyCheck.set(true));
-        assertTrue(emptyCheck.get());
+    /**
+     * Checks a block of assertions over an OptionalLong that is expected to
+     * have a particular value present.
+     */
+    void checkPresent(OptionalLong opt, long expected) {
+        assertFalse(opt.equals(OptionalLong.empty()));
+        assertFalse(OptionalLong.empty().equals(opt));
+        assertTrue(opt.equals(OptionalLong.of(expected)));
+        assertTrue(OptionalLong.of(expected).equals(opt));
+        assertFalse(opt.equals(OptionalLong.of(UNEXPECTED)));
+        assertFalse(OptionalLong.of(UNEXPECTED).equals(opt));
+        assertFalse(opt.equals("unexpected"));
 
-        try {
-            empty.ifPresentOrElse(v -> fail(), () -> { throw new ObscureException(); });
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
+        assertTrue(opt.isPresent());
+        assertEquals(opt.hashCode(), Long.hashCode(expected));
+        assertEquals(opt.orElse(UNEXPECTED), expected);
+        assertEquals(opt.orElseGet(() -> UNEXPECTED), expected);
+
+        assertEquals(opt.getAsLong(), expected);
+        assertEquals(opt.orElseThrow(), expected);
+        assertEquals(opt.orElseThrow(ObscureException::new), expected);
 
-        assertEquals(2, empty.orElse(2));
-        assertEquals(2, empty.orElseGet(()-> 2));
+        var b = new AtomicBoolean(false);
+        opt.ifPresent(s -> b.set(true));
+        assertTrue(b.get());
+
+        var b1 = new AtomicBoolean(false);
+        var b2 = new AtomicBoolean(false);
+        opt.ifPresentOrElse(s -> b1.set(true), () -> b2.set(true));
+        assertTrue(b1.get());
+        assertFalse(b2.get());
+
+        assertEquals(opt.toString(), "OptionalLong[" + expected + "]");
     }
 
     @Test(groups = "unit")
-    public void testIfPresentAndOrElseAndNull() {
-        OptionalLong empty = OptionalLong.empty();
-        OptionalLong present = OptionalLong.of(1);
-
-        // No NPE
-        present.ifPresentOrElse(v -> {}, null);
-        empty.ifPresent(null);
-        empty.ifPresentOrElse(null, () -> {});
-
-        // NPE
-        try {
-            present.ifPresent(null);
-            fail();
-        } catch (NullPointerException ex) {}
-        try {
-            present.ifPresentOrElse(null, () -> {});
-            fail();
-        } catch (NullPointerException ex) {}
-        try {
-            empty.ifPresentOrElse(v -> {}, null);
-            fail();
-        } catch (NullPointerException ex) {}
-    }
-
-    @Test(expectedExceptions=NoSuchElementException.class)
-    public void testEmptyGet() {
-        OptionalLong empty = OptionalLong.empty();
-
-        long got = empty.getAsLong();
-    }
-
-    @Test(expectedExceptions=NullPointerException.class)
-    public void testEmptyOrElseGetNull() {
-        OptionalLong empty = OptionalLong.empty();
-
-        long got = empty.orElseGet(null);
-    }
-
-    @Test(expectedExceptions=NullPointerException.class)
-    public void testEmptyOrElseThrowNull() throws Throwable {
-        OptionalLong empty = OptionalLong.empty();
-
-        long got = empty.orElseThrow(null);
-    }
-
-    @Test(expectedExceptions=ObscureException.class)
-    public void testEmptyOrElseThrow() throws Exception {
-        OptionalLong empty = OptionalLong.empty();
-
-        long got = empty.orElseThrow(ObscureException::new);
-    }
-
-    @Test(expectedExceptions=NoSuchElementException.class)
-    public void testEmptyOrElseThrowNoArg() throws Exception {
-        OptionalLong empty = OptionalLong.empty();
-
-        long got = empty.orElseThrow();
+    public void testEmpty() {
+        checkEmpty(OptionalLong.empty());
     }
 
     @Test(groups = "unit")
     public void testPresent() {
-        OptionalLong empty = OptionalLong.empty();
-        OptionalLong present = OptionalLong.of(1L);
-
-        // present
-        assertTrue(present.equals(present));
-        assertFalse(present.equals(OptionalLong.of(0L)));
-        assertTrue(present.equals(OptionalLong.of(1L)));
-        assertFalse(present.equals(empty));
-        assertTrue(Long.hashCode(1) == present.hashCode());
-        assertFalse(present.toString().isEmpty());
-        assertTrue(-1 != present.toString().indexOf(Long.toString(present.getAsLong()).toString()));
-        assertTrue(-1 != present.toString().indexOf(Long.toString(present.orElseThrow()).toString()));
-        assertEquals(1L, present.getAsLong());
-        assertEquals(1L, present.orElseThrow());
-
-        AtomicBoolean presentCheck = new AtomicBoolean();
-        present.ifPresent(v -> presentCheck.set(true));
-        assertTrue(presentCheck.get());
-        presentCheck.set(false);
-        present.ifPresentOrElse(v -> presentCheck.set(true), () -> fail());
-        assertTrue(presentCheck.get());
-
-        try {
-            present.ifPresent(v -> { throw new ObscureException(); });
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
-        try {
-            present.ifPresentOrElse(v -> {
-                throw new ObscureException();
-            }, () -> fail());
-            fail();
-        } catch (ObscureException expected) {
-        } catch (AssertionError e) {
-            throw e;
-        } catch (Throwable t) {
-            fail();
-        }
-
-        assertEquals(1, present.orElse(2));
-        assertEquals(1, present.orElseGet(null));
-        assertEquals(1, present.orElseGet(()-> 2));
-        assertEquals(1, present.orElseGet(()-> 3));
-        assertEquals(1, present.<RuntimeException>orElseThrow(null));
-        assertEquals(1, present.<RuntimeException>orElseThrow(ObscureException::new));
+        checkPresent(OptionalLong.of(LONGVAL), LONGVAL);
     }
 
     @Test(groups = "unit")
-    public void testStream() {
-        {
-            LongStream s = OptionalLong.empty().stream();
-
-            long[] es = s.toArray();
-            assertEquals(es.length, 0);
-        }
-
-        {
-            LongStream s = OptionalLong.of(42L).stream();
-
-            long[] es = s.toArray();
-            assertEquals(es.length, 1);
-            assertEquals(es[0], 42L);
-        }
+    public void testStreamEmpty() {
+        assertEquals(OptionalLong.empty().stream().toArray(), new long[] { });
     }
 
-    private static class ObscureException extends RuntimeException {
-
+    @Test(groups = "unit")
+    public void testStreamPresent() {
+        assertEquals(OptionalLong.of(LONGVAL).stream().toArray(), new long[] { LONGVAL });
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Optional/ObscureException.java	Wed Apr 04 14:32:05 2018 +0530
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * A unique exception used for checking exception types.
+ */
+public class ObscureException extends RuntimeException { }
--- a/test/langtools/ProblemList.txt	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/ProblemList.txt	Wed Apr 04 14:32:05 2018 +0530
@@ -38,6 +38,7 @@
 
 jdk/jshell/UserJdiUserRemoteTest.java                                           8173079    linux-all
 jdk/jshell/UserInputTest.java                                                   8169536    generic-all
+jdk/jshell/ExceptionsTest.java                                                  8200701    windows-all
 
 ###########################################################################
 #
--- a/test/langtools/jdk/jshell/ExceptionsTest.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/jdk/jshell/ExceptionsTest.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,16 +24,20 @@
 /*
  * @test
  * @summary Tests for exceptions
+ * @bug 8198801
  * @build KullaTesting TestingInputStream
  * @run testng ExceptionsTest
  */
 
-import jdk.jshell.SnippetEvent;
-import jdk.jshell.EvalException;
+import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import jdk.jshell.EvalException;
+import jdk.jshell.JShellException;
+import jdk.jshell.Snippet;
+import jdk.jshell.SnippetEvent;
+import jdk.jshell.UnresolvedReferenceException;
 
-import jdk.jshell.Snippet;
 import org.testng.annotations.Test;
 
 import static org.testng.Assert.*;
@@ -81,6 +85,54 @@
                         newStackTraceElement("", "", cr3.snippet(), 1)));
     }
 
+    public void throwChained() {
+        String message1 = "error_message1";
+        String message2 = "error_message2";
+        Snippet s1 = methodKey(assertEval("void p() throws Exception { ((String) null).toString(); }"));
+        Snippet s2 = methodKey(assertEval("void n() throws Exception { try { p(); } catch (Exception ex) { throw new java.io.IOException(\"" + message2 + "\", ex); }}"));
+        Snippet s3 = methodKey(assertEval("void m() {\n"
+                + "try { n(); }\n"
+                + "catch (Exception ex) {\n"
+                + "    throw new RuntimeException(\"" + message1 + "\", ex);\n"
+                + "}}"));
+        SnippetEvent cr4 = assertEvalException("m();");
+        assertExceptionMatch(cr4,
+                new ExceptionInfo(RuntimeException.class, message1,
+                        new ExceptionInfo(IOException.class, message2,
+                                new ExceptionInfo(NullPointerException.class, null,
+                                        newStackTraceElement("", "p", s1, 1),
+                                        newStackTraceElement("", "n", s2, 1),
+                                        newStackTraceElement("", "m", s3, 2),
+                                        newStackTraceElement("", "", cr4.snippet(), 1)),
+                                newStackTraceElement("", "n", s2, 1),
+                                newStackTraceElement("", "m", s3, 2),
+                                newStackTraceElement("", "", cr4.snippet(), 1)),
+                        newStackTraceElement("", "m", s3, 4),
+                        newStackTraceElement("", "", cr4.snippet(), 1)));
+    }
+
+    public void throwChainedUnresolved() {
+        String message1 = "error_message1";
+        String message2 = "error_message2";
+        Snippet s1 = methodKey(assertEval("void p() throws Exception { ((String) null).toString(); }"));
+        Snippet s2 = methodKey(assertEval("void n() throws Exception { try { p(); } catch (Exception ex) { throw new java.io.IOException(\"" + message2 + "\", ex); }}"));
+        Snippet s3 = methodKey(assertEval("void m() {\n"
+                + "try { n(); }\n"
+                + "catch (Exception ex) {\n"
+                + "    throw new RuntimeException(\"" + message1 + "\", ex);\n"
+                + "}}"));
+        getState().drop(s1);
+        SnippetEvent cr4 = assertEvalException("m();");
+        assertExceptionMatch(cr4,
+                new ExceptionInfo(RuntimeException.class, message1,
+                        new UnresolvedExceptionInfo(s2,
+                                newStackTraceElement("", "n", s2, 1),
+                                newStackTraceElement("", "m", s3, 2),
+                                newStackTraceElement("", "", cr4.snippet(), 1)),
+                        newStackTraceElement("", "m", s3, 4),
+                        newStackTraceElement("", "", cr4.snippet(), 1)));
+    }
+
     public void throwFromConstructor() {
         String message = "error_message";
         Snippet s1 = methodKey(assertEval("void f() { throw new RuntimeException(\"" + message + "\"); }"));
@@ -171,15 +223,42 @@
         return new StackTraceElement(className, methodName, "#" + key.id(), lineNumber);
     }
 
-    private static class ExceptionInfo {
-        public final Class<? extends Throwable> exception;
-        public final String message;
+    private static class AnyExceptionInfo {
+
         public final StackTraceElement[] stackTraceElements;
 
-        public ExceptionInfo(Class<? extends Throwable> exception, String message, StackTraceElement...stackTraceElements) {
+        public AnyExceptionInfo(StackTraceElement... stackTraceElements) {
+            this.stackTraceElements = stackTraceElements.length == 0 ? null : stackTraceElements;
+        }
+    }
+
+    private static class UnresolvedExceptionInfo extends AnyExceptionInfo {
+
+        public final Snippet sn;
+
+        public UnresolvedExceptionInfo(Snippet sn, StackTraceElement... stackTraceElements) {
+            super(stackTraceElements);
+            this.sn = sn;
+        }
+    }
+
+    private static class ExceptionInfo extends AnyExceptionInfo {
+
+        public final Class<? extends Throwable> exception;
+        public final String message;
+        public final AnyExceptionInfo cause;
+
+        public ExceptionInfo(Class<? extends Throwable> exception, String message,
+                StackTraceElement... stackTraceElements) {
+            this(exception, message, null, stackTraceElements);
+        }
+
+        public ExceptionInfo(Class<? extends Throwable> exception, String message,
+                AnyExceptionInfo cause, StackTraceElement... stackTraceElements) {
+            super(stackTraceElements);
             this.exception = exception;
             this.message = message;
-            this.stackTraceElements = stackTraceElements.length == 0 ? null : stackTraceElements;
+            this.cause = cause;
         }
     }
 
@@ -188,28 +267,51 @@
     }
 
     private void assertExceptionMatch(SnippetEvent cr, ExceptionInfo exceptionInfo) {
-        assertNotNull(cr.exception(), "Expected exception was not thrown: " + exceptionInfo.exception);
-        if (cr.exception() instanceof EvalException) {
-            EvalException ex = (EvalException) cr.exception();
+        assertExceptionMatch(cr.exception(), cr.snippet().source(), exceptionInfo);
+    }
+
+    private void assertExceptionMatch(Throwable exception, String source, ExceptionInfo exceptionInfo) {
+        assertNotNull(exception, "Expected exception was not thrown: " + exceptionInfo.exception);
+        if (exception instanceof EvalException) {
+            EvalException ex = (EvalException) exception;
             String actualException = ex.getExceptionClassName();
             String expectedException = exceptionInfo.exception.getCanonicalName();
-            String stackTrace = getStackTrace(ex);
-            String source = cr.snippet().source();
             assertEquals(actualException, expectedException,
                     String.format("Given \"%s\" expected exception: %s, got: %s%nStack trace:%n%s",
-                            source, expectedException, actualException, stackTrace));
+                            source, expectedException, actualException, getStackTrace(ex)));
             if (exceptionInfo.message != null) {
                 assertEquals(ex.getMessage(), exceptionInfo.message,
                         String.format("Given \"%s\" expected message: %s, got: %s",
                                 source, exceptionInfo.message, ex.getMessage()));
             }
-            if (exceptionInfo.stackTraceElements != null) {
-                assertStackTrace(ex.getStackTrace(), exceptionInfo.stackTraceElements,
-                        String.format("Given \"%s\"%nStack trace:%n%s%n",
-                                source, stackTrace));
+            assertStackMatch(ex, source, exceptionInfo);
+            if (exceptionInfo.cause != null) {
+                assertAnyExceptionMatch(exception.getCause(), exceptionInfo.cause);
             }
         } else {
-            fail("Unexpected execution exceptionInfo: " + cr.exception());
+            fail("Unexpected exception: " + exception + " or exceptionInfo: " + exceptionInfo);
+        }
+    }
+
+    private void assertStackMatch(JShellException exception, String source, AnyExceptionInfo exceptionInfo) {
+        if (exceptionInfo.stackTraceElements != null) {
+            assertStackTrace(exception.getStackTrace(), exceptionInfo.stackTraceElements,
+                    String.format("Given \"%s\"%nStack trace:%n%s%n",
+                            source, getStackTrace(exception)));
+        }
+    }
+
+    private void assertAnyExceptionMatch(Throwable exception, AnyExceptionInfo exceptionInfo) {
+        if (exceptionInfo instanceof ExceptionInfo) {
+            assertExceptionMatch(exception, "", (ExceptionInfo) exceptionInfo);
+        } else {
+            assertTrue(exceptionInfo instanceof UnresolvedExceptionInfo, "Bad exceptionInfo: " + exceptionInfo);
+            assertTrue(exception instanceof UnresolvedReferenceException,
+                    "Expected UnresolvedReferenceException: " + exception);
+            UnresolvedExceptionInfo uei = (UnresolvedExceptionInfo) exceptionInfo;
+            UnresolvedReferenceException ure = (UnresolvedReferenceException) exception;
+            assertEquals(ure.getSnippet(), uei.sn);
+            assertStackMatch(ure, "", exceptionInfo);
         }
     }
 
@@ -236,7 +338,7 @@
         }
     }
 
-    private String getStackTrace(EvalException ex) {
+    private String getStackTrace(Throwable ex) {
         StringWriter st = new StringWriter();
         ex.printStackTrace(new PrintWriter(st));
         return st.toString();
--- a/test/langtools/jdk/jshell/ToolSimpleTest.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/jdk/jshell/ToolSimpleTest.java	Wed Apr 04 14:32:05 2018 +0530
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8153716 8143955 8151754 8150382 8153920 8156910 8131024 8160089 8153897 8167128 8154513 8170015 8170368 8172102 8172103  8165405 8173073 8173848 8174041 8173916 8174028 8174262 8174797 8177079 8180508 8177466 8172154 8192979 8191842 8198573
+ * @bug 8153716 8143955 8151754 8150382 8153920 8156910 8131024 8160089 8153897 8167128 8154513 8170015 8170368 8172102 8172103  8165405 8173073 8173848 8174041 8173916 8174028 8174262 8174797 8177079 8180508 8177466 8172154 8192979 8191842 8198573 8198801
  * @summary Simple jshell tool tests
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -87,6 +87,32 @@
     }
 
     @Test
+    public void testChainedThrow() {
+        test(
+                (a) -> assertCommand(a, "void p() throws Exception { ((String) null).toString(); }",
+                        "|  created method p()"),
+                (a) -> assertCommand(a, "void n() throws Exception { try { p(); } catch (Exception ex) { throw new IOException(\"bar\", ex); }}",
+                        "|  created method n()"),
+                (a) -> assertCommand(a, "void m() { try { n(); } catch (Exception ex) { throw new RuntimeException(\"foo\", ex); }}",
+                        "|  created method m()"),
+                (a) -> assertCommand(a, "m()",
+                          "|  Exception java.lang.RuntimeException: foo\n"
+                        + "|        at m (#3:1)\n"
+                        + "|        at (#4:1)\n"
+                        + "|  Caused by: java.io.IOException: bar\n"
+                        + "|        at n (#2:1)\n"
+                        + "|        ...\n"
+                        + "|  Caused by: java.lang.NullPointerException\n"
+                        + "|        at p (#1:1)\n"
+                        + "|        ..."),
+                (a) -> assertCommand(a, "/drop p",
+                        "|  dropped method p()"),
+                (a) -> assertCommand(a, "m()",
+                        "|  attempted to call method n() which cannot be invoked until method p() is declared")
+        );
+    }
+
+    @Test
     public void oneLineOfError() {
         test(
                 (a) -> assertCommand(a, "12+", null),
--- a/test/langtools/tools/javac/ClassFileModifiers/ClassModifiers.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/ClassFileModifiers/ClassModifiers.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
  * file are correct, including those within InnerClasses attributes.
  * @author John Rose (jrose). Entered as a regression test by Bill Maddox (maddox).
  *
- * @compile/ref=ClassModifiers.out --debug:dumpmodifiers=ci ClassModifiers.java
+ * @compile/ref=ClassModifiers.out --debug=dumpmodifiers=ci ClassModifiers.java
  *
  */
 
--- a/test/langtools/tools/javac/ClassFileModifiers/MemberModifiers.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/ClassFileModifiers/MemberModifiers.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
  * @bug 4249112 4785453
  * @summary Verify that implicit member modifiers are set correctly.
  *
- * @compile/ref=MemberModifiers.out --debug:dumpmodifiers=cfm MemberModifiers.java
+ * @compile/ref=MemberModifiers.out --debug=dumpmodifiers=cfm MemberModifiers.java
  */
 
 // Currently, we check only that members of final classes are not final.
--- a/test/langtools/tools/javac/Diagnostics/6722234/T6722234a.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/Diagnostics/6722234/T6722234a.java	Wed Apr 04 14:32:05 2018 +0530
@@ -3,8 +3,8 @@
  * @bug     6722234
  * @summary javac diagnostics need better integration with the type-system
  * @author  mcimadamore
- * @compile/fail/ref=T6722234a_1.out -XDrawDiagnostics --diags:formatterOptions=disambiguateTvars T6722234a.java
- * @compile/fail/ref=T6722234a_2.out -XDrawDiagnostics --diags:formatterOptions=disambiguateTvars,where T6722234a.java
+ * @compile/fail/ref=T6722234a_1.out -XDrawDiagnostics --diags=formatterOptions=disambiguateTvars T6722234a.java
+ * @compile/fail/ref=T6722234a_2.out -XDrawDiagnostics --diags=formatterOptions=disambiguateTvars,where T6722234a.java
  */
 
 class T6722234a<T extends String> {
--- a/test/langtools/tools/javac/Diagnostics/6722234/T6722234b.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/Diagnostics/6722234/T6722234b.java	Wed Apr 04 14:32:05 2018 +0530
@@ -3,8 +3,8 @@
  * @bug     6722234 8078024
  * @summary javac diagnostics need better integration with the type-system
  * @author  mcimadamore
- * @compile/fail/ref=T6722234b_1.out -XDrawDiagnostics --diags:formatterOptions=simpleNames T6722234b.java
- * @compile/fail/ref=T6722234b_2.out -XDrawDiagnostics --diags:formatterOptions=simpleNames,where T6722234b.java
+ * @compile/fail/ref=T6722234b_1.out -XDrawDiagnostics --diags=formatterOptions=simpleNames T6722234b.java
+ * @compile/fail/ref=T6722234b_2.out -XDrawDiagnostics --diags=formatterOptions=simpleNames,where T6722234b.java
  */
 
 import java.util.*;
--- a/test/langtools/tools/javac/Diagnostics/6722234/T6722234c.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/Diagnostics/6722234/T6722234c.java	Wed Apr 04 14:32:05 2018 +0530
@@ -3,7 +3,7 @@
  * @bug     6722234
  * @summary javac diagnostics need better integration with the type-system
  * @author  mcimadamore
- * @compile/fail/ref=T6722234c.out -XDrawDiagnostics --diags:formatterOptions=simpleNames T6722234c.java
+ * @compile/fail/ref=T6722234c.out -XDrawDiagnostics --diags=formatterOptions=simpleNames T6722234c.java
  */
 
 class T6722234c {
--- a/test/langtools/tools/javac/Diagnostics/6722234/T6722234d.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/Diagnostics/6722234/T6722234d.java	Wed Apr 04 14:32:05 2018 +0530
@@ -3,8 +3,8 @@
  * @bug     6722234 8078024
  * @summary javac diagnostics need better integration with the type-system
  * @author  mcimadamore
- * @compile/fail/ref=T6722234d_1.out -XDrawDiagnostics --diags:formatterOptions=where T6722234d.java
- * @compile/fail/ref=T6722234d_2.out -XDrawDiagnostics --diags:formatterOptions=where,simpleNames T6722234d.java
+ * @compile/fail/ref=T6722234d_1.out -XDrawDiagnostics --diags=formatterOptions=where T6722234d.java
+ * @compile/fail/ref=T6722234d_2.out -XDrawDiagnostics --diags=formatterOptions=where,simpleNames T6722234d.java
  */
 
 class T6722234d {
--- a/test/langtools/tools/javac/Diagnostics/6862608/T6862608a.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/Diagnostics/6862608/T6862608a.java	Wed Apr 04 14:32:05 2018 +0530
@@ -3,7 +3,7 @@
  * @bug     6862608
  * @summary rich diagnostic sometimes contain wrong type variable numbering
  * @author  mcimadamore
- * @compile/fail/ref=T6862608a.out -XDrawDiagnostics --diags:formatterOptions=disambiguateTvars,where T6862608a.java
+ * @compile/fail/ref=T6862608a.out -XDrawDiagnostics --diags=formatterOptions=disambiguateTvars,where T6862608a.java
  */
 
 
--- a/test/langtools/tools/javac/Diagnostics/6862608/T6862608b.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/Diagnostics/6862608/T6862608b.java	Wed Apr 04 14:32:05 2018 +0530
@@ -3,7 +3,7 @@
  * @bug     6862608
  * @summary rich diagnostic sometimes contain wrong type variable numbering
  * @author  mcimadamore
- * @compile/fail/ref=T6862608b.out -XDrawDiagnostics --diags:formatterOptions=disambiguateTvars,where T6862608b.java
+ * @compile/fail/ref=T6862608b.out -XDrawDiagnostics --diags=formatterOptions=disambiguateTvars,where T6862608b.java
  */
 
 class T66862608b<T extends String, S> {
--- a/test/langtools/tools/javac/Diagnostics/7010608/Test.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/Diagnostics/7010608/Test.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,9 +46,9 @@
         try {
             test(Arrays.<String>asList(),
                     "myfo://test:1: error: cannot find symbol");
-            test(Arrays.asList("--diags:layout=OLD"),
+            test(Arrays.asList("--diags=layout=OLD"),
                     "myfo://test:1: cannot find symbol");
-            test(Arrays.asList("--diags:legacy"),
+            test(Arrays.asList("--diags=legacy"),
                     "myfo://test:1: cannot find symbol");
         } finally {
             Locale.setDefault(prev);
--- a/test/langtools/tools/javac/Diagnostics/8010387/T8010387.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/Diagnostics/8010387/T8010387.java	Wed Apr 04 14:32:05 2018 +0530
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug     8010387
  * @summary rich diagnostic sometimes contain wrong type variable numbering
- * @compile/fail/ref=T8010387.out -XDrawDiagnostics --diags:formatterOptions=disambiguateTvars,where T8010387.java
+ * @compile/fail/ref=T8010387.out -XDrawDiagnostics --diags=formatterOptions=disambiguateTvars,where T8010387.java
  */
 abstract class T8010387<X> {
 
--- a/test/langtools/tools/javac/InterfaceMemberClassModifiers.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/InterfaceMemberClassModifiers.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Verify that invalid access modifiers on interface members don't cause crash.
  * @author maddox
  *
- * @compile/fail/ref=InterfaceMemberClassModifiers.out --diags:layout=%b:%l:%_%m InterfaceMemberClassModifiers.java
+ * @compile/fail/ref=InterfaceMemberClassModifiers.out --diags=layout=%b:%l:%_%m InterfaceMemberClassModifiers.java
  */
 
 public interface InterfaceMemberClassModifiers {
--- a/test/langtools/tools/javac/T6214885.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/T6214885.java	Wed Apr 04 14:32:05 2018 +0530
@@ -2,8 +2,8 @@
  * @test  /nodynamiccopyright/
  * @bug 6214885
  * @summary This test exercises features provided by the new internal Diagnostics API
- * @compile/fail/ref=T6214885a.out --diags:layout=%b:%l%_%t%m|%p%m T6214885.java
- * @compile/fail/ref=T6214885b.out --diags:layout=%b:%l:%c%_%t%m|%p%m T6214885.java
+ * @compile/fail/ref=T6214885a.out --diags=layout=%b:%l%_%t%m|%p%m T6214885.java
+ * @compile/fail/ref=T6214885b.out --diags=layout=%b:%l:%c%_%t%m|%p%m T6214885.java
  */
 class T6214885
 {
--- a/test/langtools/tools/javac/T8026963/TypeAnnotationsCrashWithErroneousTreeTest.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/T8026963/TypeAnnotationsCrashWithErroneousTreeTest.java	Wed Apr 04 14:32:05 2018 +0530
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8026963
  * @summary type annotations code crashes for lambdas with void argument
- * @compile/fail/ref=TypeAnnotationsCrashWithErroneousTreeTest.out -XDrawDiagnostics --should-stop:at=FLOW TypeAnnotationsCrashWithErroneousTreeTest.java
+ * @compile/fail/ref=TypeAnnotationsCrashWithErroneousTreeTest.out -XDrawDiagnostics --should-stop=at=FLOW TypeAnnotationsCrashWithErroneousTreeTest.java
  */
 
 public class TypeAnnotationsCrashWithErroneousTreeTest {
--- a/test/langtools/tools/javac/annotations/neg/8022765/VerifyErroneousAnnotationsAttributed.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/annotations/neg/8022765/VerifyErroneousAnnotationsAttributed.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -237,7 +237,7 @@
         JavacTask task = tool.getTask(null,
                                       fm,
                                       devNull,
-                                      Arrays.asList("--should-stop:at=FLOW"),
+                                      Arrays.asList("--should-stop=at=FLOW"),
                                       null,
                                       Arrays.asList(new MyFileObject(code)));
 
--- a/test/langtools/tools/javac/annotations/typeAnnotations/newlocations/AfterMethodTypeParams.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/annotations/typeAnnotations/newlocations/AfterMethodTypeParams.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@
             String test = TEMPLATE.replace("CONTENT", tc.snippet);
             List<JavaFileObject> files = Arrays.asList(new MyFileObject(test));
             StringWriter out = new StringWriter();
-            List<String> options = Arrays.asList("-XDrawDiagnostics", "--should-stop:at=FLOW");
+            List<String> options = Arrays.asList("-XDrawDiagnostics", "--should-stop=at=FLOW");
             JavacTask task = (JavacTask) compiler.getTask(out, null, null, options, null, files);
 
             new TreePathScanner<Void, Void>() {
--- a/test/langtools/tools/javac/api/6731573/T6731573.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/api/6731573/T6731573.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,8 +62,8 @@
 
     enum SourceLine {
         STANDARD(null),
-        ENABLED("--diags:showSource=true"),
-        DISABLED("--diags:showSource=false");
+        ENABLED("--diags=showSource=true"),
+        DISABLED("--diags=showSource=false");
 
         String optValue;
 
--- a/test/langtools/tools/javac/api/taskListeners/EventsBalancedTest.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/api/taskListeners/EventsBalancedTest.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,11 +63,11 @@
         test(null, Arrays.asList(b, a));
 
         for (CompileState stop : CompileState.values()) {
-            test(Arrays.asList("--should-stop:ifNoError=" + stop,
-                               "--should-stop:ifError=" + stop),
+            test(Arrays.asList("--should-stop=ifNoError=" + stop,
+                               "--should-stop=ifError=" + stop),
                  Arrays.asList(a, b));
-            test(Arrays.asList("--should-stop:ifNoError=" + stop,
-                               "--should-stop:ifError=" + stop),
+            test(Arrays.asList("--should-stop=ifNoError=" + stop,
+                               "--should-stop=ifError=" + stop),
                  Arrays.asList(b, a));
         }
     }
--- a/test/langtools/tools/javac/completionDeps/DepsAndAnno.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/completionDeps/DepsAndAnno.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
     public static void main(String[] args) {
         ToolBox toolBox = new ToolBox();
         new JavacTask(toolBox, Task.Mode.CMDLINE)
-               .options("--debug:completionDeps")
+               .options("--debug=completionDeps")
                .outdir(".")
                .files(ToolBox.testSrc + "/DepsAndAnno.java")
                .run();
--- a/test/langtools/tools/javac/completionDeps/DepsAndDocLint.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/completionDeps/DepsAndDocLint.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
  * @test
  * @bug 8078389
  * @summary Make sure there is no interference between completionDeps and doclint
- * @compile --debug:completionDeps -Xdoclint DepsAndDocLint.java
+ * @compile --debug=completionDeps -Xdoclint DepsAndDocLint.java
  */
 
 public class DepsAndDocLint {
--- a/test/langtools/tools/javac/diags/examples/ApplicableMethodFound.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/ApplicableMethodFound.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 // key: compiler.misc.applicable.method.found
 // key: compiler.note.verbose.resolve.multi
-// options: --debug:verboseResolution=applicable,success
+// options: --debug=verboseResolution=applicable,success
 
 class ApplicableMethodFound {
 
--- a/test/langtools/tools/javac/diags/examples/ApplicableMethodFound1.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/ApplicableMethodFound1.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 // key: compiler.misc.applicable.method.found.1
 // key: compiler.note.verbose.resolve.multi
 // key: compiler.misc.partial.inst.sig
-// options: --debug:verboseResolution=applicable,success
+// options: --debug=verboseResolution=applicable,success
 
 class ApplicableMethodFound1 {
 
--- a/test/langtools/tools/javac/diags/examples/DeferredMethodInst.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/DeferredMethodInst.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 // key: compiler.note.verbose.resolve.multi
 // key: compiler.note.deferred.method.inst
 // key: compiler.misc.partial.inst.sig
-// options: --debug:verboseResolution=applicable,success,deferred-inference
+// options: --debug=verboseResolution=applicable,success,deferred-inference
 
 class DeferredMethodInst {
 
--- a/test/langtools/tools/javac/diags/examples/LambdaDeduplicate.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/LambdaDeduplicate.java	Wed Apr 04 14:32:05 2018 +0530
@@ -23,7 +23,7 @@
 
 
 // key: compiler.note.verbose.l2m.deduplicate
-// options: --debug:dumpLambdaToMethodDeduplication
+// options: --debug=dumpLambdaToMethodDeduplication
 
 import java.util.function.Function;
 
--- a/test/langtools/tools/javac/diags/examples/LambdaStat.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/LambdaStat.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.note.lambda.stat
-// options: --debug:dumpLambdaToMethodStats
+// options: --debug=dumpLambdaToMethodStats
 
 class LambdaStat {
     Runnable r = ()->{};
--- a/test/langtools/tools/javac/diags/examples/MrefStat.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/MrefStat.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.note.mref.stat
-// options: --debug:dumpLambdaToMethodStats
+// options: --debug=dumpLambdaToMethodStats
 
 class MrefStat {
     Runnable r = MrefStat::m;
--- a/test/langtools/tools/javac/diags/examples/MrefStat1.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/MrefStat1.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.note.mref.stat.1
-// options: --debug:dumpLambdaToMethodStats
+// options: --debug=dumpLambdaToMethodStats
 
 class MrefStat1 {
 
--- a/test/langtools/tools/javac/diags/examples/NotApplicableMethodFound.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/NotApplicableMethodFound.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 // key: compiler.err.cant.apply.symbol
 // key: compiler.misc.no.conforming.assignment.exists
 // key: compiler.misc.inconvertible.types
-// options: --debug:verboseResolution=inapplicable,failure
+// options: --debug=verboseResolution=inapplicable,failure
 
 class NotApplicableMethodFound {
 
--- a/test/langtools/tools/javac/diags/examples/PartialInstSig.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/PartialInstSig.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 // key: compiler.misc.applicable.method.found.1
 // key: compiler.note.verbose.resolve.multi
 // key: compiler.misc.partial.inst.sig
-// options: --debug:verboseResolution=applicable,success
+// options: --debug=verboseResolution=applicable,success
 
 class PartialInstSig {
 
--- a/test/langtools/tools/javac/diags/examples/VerboseResolveMulti.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/VerboseResolveMulti.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 // key: compiler.misc.applicable.method.found
 // key: compiler.note.verbose.resolve.multi
-// options: --debug:verboseResolution=applicable,success
+// options: --debug=verboseResolution=applicable,success
 
 class VerboseResolveMulti {
 
--- a/test/langtools/tools/javac/diags/examples/VerboseResolveMulti1.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/VerboseResolveMulti1.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 // key: compiler.err.cant.apply.symbol
 // key: compiler.misc.no.conforming.assignment.exists
 // key: compiler.misc.inconvertible.types
-// options: --debug:verboseResolution=inapplicable,failure
+// options: --debug=verboseResolution=inapplicable,failure
 
 class VerboseResolveMulti1 {
 
--- a/test/langtools/tools/javac/diags/examples/WhereCaptured.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/WhereCaptured.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 // key: compiler.err.cant.apply.symbol
 // key: compiler.misc.incompatible.eq.bounds
 // key: compiler.misc.captured.type
-// options: --diags:formatterOptions=where,simpleNames
+// options: --diags=formatterOptions=where,simpleNames
 // run: simple
 
 import java.util.*;
--- a/test/langtools/tools/javac/diags/examples/WhereCaptured1.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/WhereCaptured1.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 // key: compiler.misc.incompatible.eq.bounds
 // key: compiler.misc.captured.type
 // key: compiler.misc.type.null
-// options: --diags:formatterOptions=where,simpleNames
+// options: --diags=formatterOptions=where,simpleNames
 // run: simple
 
 import java.util.*;
--- a/test/langtools/tools/javac/diags/examples/WhereFreshTvar.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/WhereFreshTvar.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 // key: compiler.misc.where.description.typevar
 // key: compiler.err.prob.found.req
 // key: compiler.misc.inconvertible.types
-// options: --diags:formatterOptions=where,simpleNames
+// options: --diags=formatterOptions=where,simpleNames
 // run: simple
 
 import java.util.*;
--- a/test/langtools/tools/javac/diags/examples/WhereIntersection.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/WhereIntersection.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 // key: compiler.misc.where.description.intersection.1
 // key: compiler.misc.where.intersection
 // key: compiler.err.prob.found.req
-// options: --diags:formatterOptions=where
+// options: --diags=formatterOptions=where
 // run: simple
 
 class WhereIntersection {
--- a/test/langtools/tools/javac/diags/examples/WhereIntersection2.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/WhereIntersection2.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 // key: compiler.misc.where.description.intersection
 // key: compiler.misc.where.intersection
 // key: compiler.err.prob.found.req
-// options: --diags:formatterOptions=where
+// options: --diags=formatterOptions=where
 // run: simple
 
 class WhereIntersection2 {
--- a/test/langtools/tools/javac/diags/examples/WhereTypeVar.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/WhereTypeVar.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 // key: compiler.err.cant.apply.symbol
 // key: compiler.misc.no.conforming.assignment.exists
 // key: compiler.misc.inconvertible.types
-// options: --diags:formatterOptions=where,disambiguateTvars
+// options: --diags=formatterOptions=where,disambiguateTvars
 // run: simple
 
 class WhereTypeVar<T extends String> {
--- a/test/langtools/tools/javac/diags/examples/WhereTypeVar2.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/diags/examples/WhereTypeVar2.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 // key: compiler.misc.where.description.typevar
 // key: compiler.misc.where.typevar
 // key: compiler.err.prob.found.req
-// options: --diags:formatterOptions=where
+// options: --diags=formatterOptions=where
 // run: simple
 
 class WhereTypeVar2 {
--- a/test/langtools/tools/javac/failover/CheckAttributedTree.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/CheckAttributedTree.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -315,7 +315,7 @@
             totalNumberOfCompilations++;
             newCompilationTask()
                 .withWriter(pw)
-                    .withOption("--should-stop:at=ATTR")
+                    .withOption("--should-stop=at=ATTR")
                     .withOption("-XDverboseCompilePolicy")
                     .withOption("-Xdoclint:none")
                     .withSource(files.iterator().next())
--- a/test/langtools/tools/javac/failover/FailOver01.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver01.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver01.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver01.java
+ * @compile/fail/ref=FailOver01.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver01.java
  */
 
 class Test { { x = "" } }
--- a/test/langtools/tools/javac/failover/FailOver02.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver02.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver02.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver02.java
+ * @compile/fail/ref=FailOver02.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver02.java
  */
 
 class Test implements AutoCloseable {
--- a/test/langtools/tools/javac/failover/FailOver03.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver03.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver03.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver03.java
+ * @compile/fail/ref=FailOver03.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver03.java
  */
 
 class Test extends Test {
--- a/test/langtools/tools/javac/failover/FailOver04.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver04.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver04.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver04.java
+ * @compile/fail/ref=FailOver04.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver04.java
  */
 
 class Test {
--- a/test/langtools/tools/javac/failover/FailOver05.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver05.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver05.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver05.java
+ * @compile/fail/ref=FailOver05.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver05.java
  */
 
 class Test extends Test {
--- a/test/langtools/tools/javac/failover/FailOver06.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver06.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver06.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver06.java
+ * @compile/fail/ref=FailOver06.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver06.java
  */
 
 class Test extends Test {
--- a/test/langtools/tools/javac/failover/FailOver07.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver07.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver07.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver07.java
+ * @compile/fail/ref=FailOver07.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver07.java
  */
 
 class Test extends Test {
--- a/test/langtools/tools/javac/failover/FailOver08.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver08.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver08.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver08.java
+ * @compile/fail/ref=FailOver08.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver08.java
  */
 
 class Test extends Test {
--- a/test/langtools/tools/javac/failover/FailOver09.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver09.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver09.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver09.java
+ * @compile/fail/ref=FailOver09.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver09.java
  */
 
 class Test extends Test {
--- a/test/langtools/tools/javac/failover/FailOver10.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver10.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver10.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver10.java
+ * @compile/fail/ref=FailOver10.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver10.java
  */
 
 class Test extends Test {
--- a/test/langtools/tools/javac/failover/FailOver11.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver11.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver11.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver11.java
+ * @compile/fail/ref=FailOver11.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver11.java
  */
 
 class Test extends Test {
--- a/test/langtools/tools/javac/failover/FailOver12.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver12.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver12.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver12.java
+ * @compile/fail/ref=FailOver12.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver12.java
  */
 
 class Test extends Test {
--- a/test/langtools/tools/javac/failover/FailOver13.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver13.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver13.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver13.java
+ * @compile/fail/ref=FailOver13.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver13.java
  */
 
 class Test extends Test {
--- a/test/langtools/tools/javac/failover/FailOver14.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver14.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Flow.java should be more error-friendly
  * @author mcimadamore
  *
- * @compile/fail/ref=FailOver14.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver14.java
+ * @compile/fail/ref=FailOver14.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver14.java
  */
 
 class Test extends Test  {
--- a/test/langtools/tools/javac/failover/FailOver15.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/failover/FailOver15.java	Wed Apr 04 14:32:05 2018 +0530
@@ -3,7 +3,7 @@
  * @bug 6970584 7060926
  * @summary Attr.PostAttrAnalyzer misses a case
  *
- * @compile/fail/ref=FailOver15.out -XDrawDiagnostics --should-stop:at=FLOW -XDdev FailOver15.java
+ * @compile/fail/ref=FailOver15.out -XDrawDiagnostics --should-stop=at=FLOW -XDdev FailOver15.java
  */
 
 class Test {
--- a/test/langtools/tools/javac/generics/inference/8158355/T8158355.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/generics/inference/8158355/T8158355.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
  * @test
  * @bug 8158355
  * @summary Inference graph dot support broken
- * @compile --debug:dumpInferenceGraphsTo=. T8158355.java
+ * @compile --debug=dumpInferenceGraphsTo=. T8158355.java
  */
 import java.util.List;
 
--- a/test/langtools/tools/javac/lambda/MostSpecific09.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/lambda/MostSpecific09.java	Wed Apr 04 14:32:05 2018 +0530
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8029718 8065800
  * @summary Should always use lambda body structure to disambiguate overload resolution
- * @compile/fail/ref=MostSpecific09.out -XDrawDiagnostics --should-stop:at=ATTR --debug:verboseResolution=applicable,success MostSpecific09.java
+ * @compile/fail/ref=MostSpecific09.out -XDrawDiagnostics --should-stop=at=ATTR --debug=verboseResolution=applicable,success MostSpecific09.java
  */
 
 class MostSpecific09 {
--- a/test/langtools/tools/javac/lambda/TestLambdaToMethodStats.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/lambda/TestLambdaToMethodStats.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@
     @Override
     public void doWork() throws IOException {
         newCompilationTask()
-                .withOption("--debug:dumpLambdaToMethodStats")
+                .withOption("--debug=dumpLambdaToMethodStats")
                 .withSourceFromTemplate(template)
                 .generate(this::check);
     }
--- a/test/langtools/tools/javac/lambda/XDdumpLambdaToMethodStats.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/lambda/XDdumpLambdaToMethodStats.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
  * @test
  * @bug 8143217
  * @summary javac throws NPE when printing diagnostics for Lambda expressions
- * @compile XDdumpLambdaToMethodStats.java --debug:dumpLambdaToMethodStats
+ * @compile XDdumpLambdaToMethodStats.java --debug=dumpLambdaToMethodStats
  *
  */
 
--- a/test/langtools/tools/javac/lambda/bridge/TestMetafactoryBridges.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/lambda/bridge/TestMetafactoryBridges.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -274,7 +274,7 @@
             sourcefiles.add(new JavaSource(ck));
         }
         JavacTask ct = (JavacTask)tool.getTask(debugWriter, null, diagChecker,
-                    Arrays.asList("--debug:dumpLambdaToMethodStats", "-d", outDir.getAbsolutePath(),
+                    Arrays.asList("--debug=dumpLambdaToMethodStats", "-d", outDir.getAbsolutePath(),
                                   "-sourcepath", srcDir.getAbsolutePath(),
                                   "-classpath", classesDir.getAbsolutePath(),
                                   pp.preferOpt), null, sourcefiles);
--- a/test/langtools/tools/javac/lambda/mostSpecific/StructuralMostSpecificTest.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/lambda/mostSpecific/StructuralMostSpecificTest.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -210,7 +210,7 @@
     public void doWork() throws Throwable {
         newCompilationTask()
                 .withSourceFromTemplate(sourceTemplate)
-                .withOption("--debug:verboseResolution=all,-predef,-internal,-object-init")
+                .withOption("--debug=verboseResolution=all,-predef,-internal,-object-init")
                 .analyze(this::check);
     }
 
--- a/test/langtools/tools/javac/missingSuperRecovery/MissingSuperRecovery.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/missingSuperRecovery/MissingSuperRecovery.java	Wed Apr 04 14:32:05 2018 +0530
@@ -5,7 +5,7 @@
  * class is no longer available during a subsequent compilation.
  * @author maddox
  * @build impl
- * @compile/fail/ref=MissingSuperRecovery.out --diags:layout=%b:%l:%_%m MissingSuperRecovery.java
+ * @compile/fail/ref=MissingSuperRecovery.out --diags=layout=%b:%l:%_%m MissingSuperRecovery.java
  */
 
 // Requires "golden" class file 'impl.class', which contains
--- a/test/langtools/tools/javac/modules/AddLimitMods.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/modules/AddLimitMods.java	Wed Apr 04 14:32:05 2018 +0530
@@ -120,7 +120,7 @@
         //real test
         new JavacTask(tb)
                 .options("--module-path", modulePath.toString(),
-                         "--should-stop:ifNoError=FLOW",
+                         "--should-stop=ifNoError=FLOW",
                          "--limit-modules", "java.base")
                 .outdir(modulePath)
                 .files(findJavaFiles(m1))
@@ -129,7 +129,7 @@
 
         new JavacTask(tb)
                 .options("--module-path", modulePath.toString(),
-                         "--should-stop:ifNoError=FLOW",
+                         "--should-stop=ifNoError=FLOW",
                          "--limit-modules", "java.base",
                          "--add-modules", "m2x")
                 .outdir(modulePath)
@@ -139,7 +139,7 @@
 
         new JavacTask(tb)
                 .options("--module-path", modulePath.toString(),
-                         "--should-stop:ifNoError=FLOW",
+                         "--should-stop=ifNoError=FLOW",
                          "--limit-modules", "java.base",
                          "--add-modules", "m2x,m3x")
                 .outdir(modulePath)
@@ -149,7 +149,7 @@
 
         new JavacTask(tb)
                 .options("--module-path", modulePath.toString(),
-                         "--should-stop:ifNoError=FLOW",
+                         "--should-stop=ifNoError=FLOW",
                          "--limit-modules", "m2x")
                 .outdir(modulePath)
                 .files(findJavaFiles(m1))
@@ -158,7 +158,7 @@
 
         new JavacTask(tb)
                 .options("--module-path", modulePath.toString(),
-                         "--should-stop:ifNoError=FLOW",
+                         "--should-stop=ifNoError=FLOW",
                          "--limit-modules", "m3x")
                 .outdir(modulePath)
                 .files(findJavaFiles(m1))
@@ -167,7 +167,7 @@
 
         new JavacTask(tb)
                 .options("--module-path", modulePath.toString(),
-                         "--should-stop:ifNoError=FLOW",
+                         "--should-stop=ifNoError=FLOW",
                          "--limit-modules", "m3x",
                          "--add-modules", "m2x")
                 .outdir(modulePath)
@@ -430,7 +430,7 @@
                                            auxOptions,
                                            "--module-path", modulePath.toString(),
                                            "--class-path", classpathOut.toString(),
-                                           "--should-stop:ifNoError=FLOW"))
+                                           "--should-stop=ifNoError=FLOW"))
                    .outdir(modulePath)
                    .files(findJavaFiles(m2))
                    .run(success ? Task.Expect.SUCCESS : Task.Expect.FAIL)
--- a/test/langtools/tools/javac/options/IsSupportedOptionTest.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/options/IsSupportedOptionTest.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
         check(tool, "-Xdoclint", 0);
         check(tool, "-Xdoclint:stats", 0);
         check(tool, "-Xdoclint/package:foo", 0);
-        check(tool, "--debug:any", 0);
+        check(tool, "--debug=any", 1);
         check(tool, "-g", 0);
         check(tool, "-g:vars", 0);
         check(tool, "-g:none", 0);
--- a/test/langtools/tools/javac/policy/test3/Test.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/policy/test3/Test.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
 import java.io.*;
 import java.util.*;
 
-// Simple test of --should-stop:at.
+// Simple test of --should-stop=at.
 // For each of the permissable values, we compile a file with an error in it,
 // then using -XDverboseCompilePolicy we check that the compilation gets as
 // far as expected, but no further.
@@ -83,7 +83,7 @@
         args.add("-d");
         args.add(".");
         if (ssp.needOption)
-            args.add("--should-stop:at=" + ssp);
+            args.add("--should-stop=at=" + ssp);
         args.add(new File(System.getProperty("test.src", "."), "A.java").getPath());
 
         StringWriter sw = new StringWriter();
--- a/test/langtools/tools/javac/positions/TreeEndPosTest.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/positions/TreeEndPosTest.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -145,7 +145,7 @@
             options.add(tempDir.getPath());
             options.add("-d");
             options.add(tempDir.getPath());
-            options.add("--should-stop:at=GENERATE");
+            options.add("--should-stop=at=GENERATE");
 
             List<JavaFileObject> sources = new ArrayList<>();
             sources.add(src);
--- a/test/langtools/tools/javac/protectedAccess/ProtectedMemberAccess2.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/protectedAccess/ProtectedMemberAccess2.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Verify correct implementation of JLS2e 6.6.2.1
  * @author maddox
  *
- * @compile/fail/ref=ProtectedMemberAccess2.out --diags:formatterOptions=-simpleNames;layout=%b:%l:%_%m ProtectedMemberAccess2.java
+ * @compile/fail/ref=ProtectedMemberAccess2.out --diags=formatterOptions=-simpleNames;layout=%b:%l:%_%m ProtectedMemberAccess2.java
  */
 
 // 71 errors expected.
--- a/test/langtools/tools/javac/protectedAccess/ProtectedMemberAccess3.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/protectedAccess/ProtectedMemberAccess3.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Verify correct implementation of JLS2e 6.6.2.1
  * @author maddox
  *
- * @compile/fail/ref=ProtectedMemberAccess3.out --diags:formatterOptions=-simpleNames;layout=%b:%l:%_%m ProtectedMemberAccess3.java
+ * @compile/fail/ref=ProtectedMemberAccess3.out --diags=formatterOptions=-simpleNames;layout=%b:%l:%_%m ProtectedMemberAccess3.java
  */
 
 // 46 errors expected.
--- a/test/langtools/tools/javac/protectedAccess/ProtectedMemberAccess4.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/protectedAccess/ProtectedMemberAccess4.java	Wed Apr 04 14:32:05 2018 +0530
@@ -4,7 +4,7 @@
  * @summary Verify correct implementation of JLS2e 6.6.2.1
  * @author maddox
  *
- * @compile/fail/ref=ProtectedMemberAccess4.out --diags:formatterOptions=-simpleNames;layout=%b:%l:%_%m ProtectedMemberAccess4.java
+ * @compile/fail/ref=ProtectedMemberAccess4.out --diags=formatterOptions=-simpleNames;layout=%b:%l:%_%m ProtectedMemberAccess4.java
  */
 
 // 33 errors expected.
--- a/test/langtools/tools/javac/resolve/ResolveHarness.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/resolve/ResolveHarness.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -132,8 +132,8 @@
 
     protected void check() throws Exception {
         String[] options = {
-            "--should-stop:at=ATTR",
-            "--debug:verboseResolution=success,failure,applicable,inapplicable,deferred-inference,predef"
+            "--should-stop=at=ATTR",
+            "--debug=verboseResolution=success,failure,applicable,inapplicable,deferred-inference,predef"
         };
 
         AbstractProcessor[] processors = { new ResolveCandidateFinder(), null };
--- a/test/langtools/tools/javac/tree/VarTree.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/tree/VarTree.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@
         String src = prefix + parts[0] + parts[1] + parts[2] + " } }";
 
         JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, null, d -> {},
-                                                        List.of("--should-stop:at=FLOW"),
+                                                        List.of("--should-stop=at=FLOW"),
                                                         null, Arrays.asList(new MyFileObject(src)));
 
         Iterable<? extends CompilationUnitTree> units = ct.parse();
--- a/test/langtools/tools/javac/unicode/UnicodeNewline.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/javac/unicode/UnicodeNewline.java	Wed Apr 04 14:32:05 2018 +0530
@@ -3,7 +3,7 @@
  * @bug 4739428 4785453
  * @summary when \u000a is used, diagnostics are reported on the wrong line.
  *
- * @compile/fail/ref=UnicodeNewline.out --diags:layout=%b:%l:%_%m UnicodeNewline.java
+ * @compile/fail/ref=UnicodeNewline.out --diags=layout=%b:%l:%_%m UnicodeNewline.java
  */
 
 class UnicodeNewline {
--- a/test/langtools/tools/sjavac/JavacOptionPrep.java	Mon Apr 02 16:56:58 2018 +0530
+++ b/test/langtools/tools/sjavac/JavacOptionPrep.java	Wed Apr 04 14:32:05 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@
 
             // Ignore this option for now. When the file=... requirement goes
             // away, this will be easier to handle.
-            if (option.startsWith("--debug:completionDeps"))
+            if (option.startsWith("--debug=completionDeps"))
                 continue;
 
             switch (option) {