changeset 14488:2ac07d4a97d4

Merge
author amurillo
date Tue, 17 May 2016 05:38:15 -0700
parents 3eea6819cc1f df25fad96353
children 0c3d4e928055
files src/java.base/share/classes/java/lang/invoke/VarHandle.java src/java.httpclient/share/classes/java/net/http/HttpHeaders1.java src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginContextImpl.java src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PoolImpl.java src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/PluginContext.java src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Pool.java test/java/lang/invoke/VarHandles/VarHandleBaseTest.java test/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java test/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java test/java/lang/invoke/VarHandles/VarHandleTestAccessString.java test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsShort.java test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java test/java/lang/invoke/VarHandles/X-VarHandleTestAccess.java.template test/java/lang/invoke/VarHandles/X-VarHandleTestByteArrayView.java.template test/java/lang/invoke/VarHandles/X-VarHandleTestMethodHandleAccess.java.template
diffstat 153 files changed, 4490 insertions(+), 4989 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/invoke/Invokers.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/Invokers.java	Tue May 17 05:38:15 2016 -0700
@@ -95,12 +95,12 @@
 
     /*non-public*/ MethodHandle varHandleMethodInvoker(VarHandle.AccessMode ak) {
         // TODO cache invoker
-        return makeVarHandleMethodInvoker(ak);
+        return makeVarHandleMethodInvoker(ak, false);
     }
 
     /*non-public*/ MethodHandle varHandleMethodExactInvoker(VarHandle.AccessMode ak) {
         // TODO cache invoker
-        return makeVarHandleMethodExactInvoker(ak);
+        return makeVarHandleMethodInvoker(ak, true);
     }
 
     private MethodHandle cachedInvoker(int idx) {
@@ -127,26 +127,11 @@
         return invoker;
     }
 
-    private MethodHandle makeVarHandleMethodInvoker(VarHandle.AccessMode ak) {
+    private MethodHandle makeVarHandleMethodInvoker(VarHandle.AccessMode ak, boolean isExact) {
         MethodType mtype = targetType;
         MethodType invokerType = mtype.insertParameterTypes(0, VarHandle.class);
 
-        LambdaForm lform = varHandleMethodGenericInvokerHandleForm(ak.methodName(), mtype);
-        VarHandle.AccessDescriptor ad = new VarHandle.AccessDescriptor(mtype, ak.at.ordinal(), ak.ordinal());
-        MethodHandle invoker = BoundMethodHandle.bindSingle(invokerType, lform, ad);
-
-        invoker = invoker.withInternalMemberName(MemberName.makeVarHandleMethodInvoke(ak.methodName(), mtype), false);
-        assert(checkVarHandleInvoker(invoker));
-
-        maybeCompileToBytecode(invoker);
-        return invoker;
-    }
-
-    private MethodHandle makeVarHandleMethodExactInvoker(VarHandle.AccessMode ak) {
-        MethodType mtype = targetType;
-        MethodType invokerType = mtype.insertParameterTypes(0, VarHandle.class);
-
-        LambdaForm lform = varHandleMethodExactInvokerHandleForm(ak.methodName(), mtype);
+        LambdaForm lform = varHandleMethodInvokerHandleForm(ak.methodName(), mtype, isExact);
         VarHandle.AccessDescriptor ad = new VarHandle.AccessDescriptor(mtype, ak.at.ordinal(), ak.ordinal());
         MethodHandle invoker = BoundMethodHandle.bindSingle(invokerType, lform, ad);
 
@@ -400,59 +385,7 @@
         return lform;
     }
 
-    private static LambdaForm varHandleMethodExactInvokerHandleForm(String name, MethodType mtype) {
-        // TODO Cache form?
-
-        final int THIS_MH      = 0;
-        final int CALL_VH      = THIS_MH + 1;
-        final int ARG_BASE     = CALL_VH + 1;
-        final int ARG_LIMIT = ARG_BASE + mtype.parameterCount();
-        int nameCursor = ARG_LIMIT;
-        final int VAD_ARG      = nameCursor++;
-        final int CHECK_TYPE   = nameCursor++;
-        final int GET_MEMBER   = nameCursor++;
-        final int LINKER_CALL  = nameCursor++;
-
-        MethodType invokerFormType = mtype.insertParameterTypes(0, VarHandle.class)
-                .basicType()
-                .appendParameterTypes(MemberName.class);
-
-        MemberName linker = new MemberName(MethodHandle.class, "linkToStatic", invokerFormType, REF_invokeStatic);
-        try {
-            linker = MemberName.getFactory().resolveOrFail(REF_invokeStatic, linker, null, NoSuchMethodException.class);
-        } catch (ReflectiveOperationException ex) {
-            throw newInternalError(ex);
-        }
-
-        Name[] names = new Name[LINKER_CALL + 1];
-        names[THIS_MH] = argument(THIS_MH, BasicType.basicType(Object.class));
-        names[CALL_VH] = argument(CALL_VH, BasicType.basicType(Object.class));
-        for (int i = 0; i < mtype.parameterCount(); i++) {
-            names[ARG_BASE + i] = argument(ARG_BASE + i, BasicType.basicType(mtype.parameterType(i)));
-        }
-
-        BoundMethodHandle.SpeciesData speciesData = BoundMethodHandle.speciesData_L();
-        names[THIS_MH] = names[THIS_MH].withConstraint(speciesData);
-
-        NamedFunction getter = speciesData.getterFunction(0);
-        names[VAD_ARG] = new Name(getter, names[THIS_MH]);
-
-        Object[] outArgs = Arrays.copyOfRange(names, CALL_VH, ARG_LIMIT + 1, Object[].class);
-
-        names[CHECK_TYPE] = new Name(NF_checkVarHandleExactType, names[CALL_VH], names[VAD_ARG]);
-
-        names[GET_MEMBER] = new Name(NF_getVarHandleMemberName, names[CALL_VH], names[VAD_ARG]);
-        outArgs[outArgs.length - 1] = names[GET_MEMBER];
-
-        names[LINKER_CALL] = new Name(linker, outArgs);
-        LambdaForm lform = new LambdaForm(name + ":VarHandle_exactInvoker" + shortenSignature(basicTypeSignature(mtype)),
-                                          ARG_LIMIT, names);
-
-        lform.compileToBytecode();
-        return lform;
-    }
-
-    private static LambdaForm varHandleMethodGenericInvokerHandleForm(String name, MethodType mtype) {
+    private static LambdaForm varHandleMethodInvokerHandleForm(String name, MethodType mtype, boolean isExact) {
         // TODO Cache form?
 
         final int THIS_MH      = 0;
@@ -477,8 +410,11 @@
         NamedFunction getter = speciesData.getterFunction(0);
         names[VAD_ARG] = new Name(getter, names[THIS_MH]);
 
-        names[CHECK_TYPE] = new Name(NF_checkVarHandleGenericType, names[CALL_VH], names[VAD_ARG]);
-
+        if (isExact) {
+            names[CHECK_TYPE] = new Name(NF_checkVarHandleExactType, names[CALL_VH], names[VAD_ARG]);
+        } else {
+            names[CHECK_TYPE] = new Name(NF_checkVarHandleGenericType, names[CALL_VH], names[VAD_ARG]);
+        }
         Object[] outArgs = new Object[ARG_LIMIT];
         outArgs[0] = names[CHECK_TYPE];
         for (int i = 1; i < ARG_LIMIT; i++) {
@@ -488,7 +424,8 @@
         MethodType outCallType = mtype.insertParameterTypes(0, VarHandle.class)
                 .basicType();
         names[LINKER_CALL] = new Name(outCallType, outArgs);
-        LambdaForm lform = new LambdaForm(name + ":VarHandle_invoker" + shortenSignature(basicTypeSignature(mtype)),
+        String debugName = isExact ? ":VarHandle_exactInvoker" : ":VarHandle_invoker";
+        LambdaForm lform = new LambdaForm(name + debugName + shortenSignature(basicTypeSignature(mtype)),
                                           ARG_LIMIT, names);
 
         lform.prepare();
@@ -511,21 +448,13 @@
 
     /*non-public*/ static
     @ForceInline
-    void checkVarHandleExactType(VarHandle handle, VarHandle.AccessDescriptor ad) {
-        MethodType erasedTarget = handle.vform.methodType_table[ad.type];
-        MethodType erasedSymbolic = ad.symbolicMethodTypeErased;
-        if (erasedTarget != erasedSymbolic)
-            throw newWrongMethodTypeException(erasedTarget, erasedSymbolic);
-    }
-
-    /*non-public*/ static
-    @ForceInline
-    MemberName getVarHandleMemberName(VarHandle handle, VarHandle.AccessDescriptor ad) {
-        MemberName mn = handle.vform.memberName_table[ad.mode];
-        if (mn == null) {
-            throw handle.unsupported();
+    MethodHandle checkVarHandleExactType(VarHandle handle, VarHandle.AccessDescriptor ad) {
+        MethodHandle mh = handle.getMethodHandle(ad.mode);
+        MethodType mt = mh.type();
+        if (mt != ad.symbolicMethodTypeInvoker) {
+            throw newWrongMethodTypeException(mt, ad.symbolicMethodTypeInvoker);
         }
-        return mn;
+        return mh;
     }
 
     /*non-public*/ static
@@ -649,8 +578,7 @@
         NF_getCallSiteTarget,
         NF_checkCustomized,
         NF_checkVarHandleGenericType,
-        NF_checkVarHandleExactType,
-        NF_getVarHandleMemberName;
+        NF_checkVarHandleExactType;
     static {
         try {
             NamedFunction nfs[] = {
@@ -666,8 +594,6 @@
                         .getDeclaredMethod("checkVarHandleGenericType", VarHandle.class, VarHandle.AccessDescriptor.class)),
                 NF_checkVarHandleExactType = new NamedFunction(Invokers.class
                         .getDeclaredMethod("checkVarHandleExactType", VarHandle.class, VarHandle.AccessDescriptor.class)),
-                NF_getVarHandleMemberName = new NamedFunction(Invokers.class
-                        .getDeclaredMethod("getVarHandleMemberName", VarHandle.class, VarHandle.AccessDescriptor.class))
             };
             // Each nf must be statically invocable or we get tied up in our bootstraps.
             assert(InvokerBytecodeGenerator.isStaticallyInvocable(nfs));
--- a/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Tue May 17 05:38:15 2016 -0700
@@ -1475,11 +1475,11 @@
         TypesAndInvokers tis = getTypesAndInvokers();
         MethodHandle mh = tis.methodHandle_table[mode];
         if (mh == null) {
-            mh = tis.methodHandle_table[mode] = getMethodHandleUncached(tis, mode);
+            mh = tis.methodHandle_table[mode] = getMethodHandleUncached(mode);
         }
         return mh;
     }
-    private final MethodHandle getMethodHandleUncached(TypesAndInvokers tis, int mode) {
+    private final MethodHandle getMethodHandleUncached(int mode) {
         MethodType mt = accessModeType(AccessMode.values()[mode]).
                 insertParameterTypes(0, VarHandle.class);
         MemberName mn = vform.getMemberName(mode);
--- a/src/java.base/share/classes/java/nio/Buffer.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.base/share/classes/java/nio/Buffer.java	Tue May 17 05:38:15 2016 -0700
@@ -111,7 +111,7 @@
  * to zero.
  *
  *
- * <h2> Clearing, flipping, and rewinding </h2>
+ * <h2> Additional operations </h2>
  *
  * <p> In addition to methods for accessing the position, limit, and capacity
  * values and for marking and resetting, this class also defines the following
@@ -131,6 +131,12 @@
  *   it already contains: It leaves the limit unchanged and sets the position
  *   to zero.  </p></li>
  *
+ *   <li><p> {@link #slice} creates a subsequence of a buffer: It leaves the
+ *   limit and the position unchanged. </p></li>
+ *
+ *   <li><p> {@link #duplicate} creates a shallow copy of a buffer: It leaves
+ *   the limit and the position unchanged. </p></li>
+ *
  * </ul>
  *
  *
@@ -567,6 +573,46 @@
      */
     public abstract boolean isDirect();
 
+    /**
+     * Creates a new buffer whose content is a shared subsequence of
+     * this buffer's content.
+     *
+     * <p> The content of the new buffer will start at this buffer's current
+     * position.  Changes to this buffer's content will be visible in the new
+     * buffer, and vice versa; the two buffers' position, limit, and mark
+     * values will be independent.
+     *
+     * <p> The new buffer's position will be zero, its capacity and its limit
+     * will be the number of elements remaining in this buffer, its mark will be
+     * undefined. The new buffer will be direct if, and only if, this buffer is
+     * direct, and it will be read-only if, and only if, this buffer is
+     * read-only.  </p>
+     *
+     * @return  The new buffer
+     *
+     * @since 9
+     */
+    public abstract Buffer slice();
+
+    /**
+     * Creates a new buffer that shares this buffer's content.
+     *
+     * <p> The content of the new buffer will be that of this buffer.  Changes
+     * to this buffer's content will be visible in the new buffer, and vice
+     * versa; the two buffers' position, limit, and mark values will be
+     * independent.
+     *
+     * <p> The new buffer's capacity, limit, position and mark values will be
+     * identical to those of this buffer. The new buffer will be direct if, and
+     * only if, this buffer is direct, and it will be read-only if, and only if,
+     * this buffer is read-only.  </p>
+     *
+     * @return  The new buffer
+     *
+     * @since 9
+     */
+    public abstract Buffer duplicate();
+
 
     // -- Package-private methods for bounds checking, etc. --
 
--- a/src/java.base/share/classes/java/nio/X-Buffer.java.template	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.base/share/classes/java/nio/X-Buffer.java.template	Tue May 17 05:38:15 2016 -0700
@@ -70,8 +70,7 @@
  *
 #end[byte]
  *
- *   <li><p> Methods for {@link #compact compacting}, {@link
- *   #duplicate duplicating}, and {@link #slice slicing}
+ *   <li><p> A method for {@link #compact compacting}
  *   $a$ $type$ buffer.  </p></li>
  *
  * </ul>
@@ -535,6 +534,7 @@
      * @see #alignedSlice(int)
 #end[byte]
      */
+    @Override
     public abstract $Type$Buffer slice();
 
     /**
@@ -557,6 +557,7 @@
      *
      * @return  The new $type$ buffer
      */
+    @Override
     public abstract $Type$Buffer duplicate();
 
     /**
--- a/src/java.base/share/classes/java/util/DualPivotQuicksort.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.base/share/classes/java/util/DualPivotQuicksort.java	Tue May 17 05:38:15 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -146,12 +146,26 @@
             }
         }
 
-        // Check special cases
-        // Implementation note: variable "right" is increased by 1.
-        if (run[count] == right++) { // The last run contains one element
+        // These invariants should hold true:
+        //    run[0] = 0
+        //    run[<last>] = right + 1; (terminator)
+
+        if (count == 0) {
+            // A single equal run
+            return;
+        } else if (count == 1 && run[count] > right) {
+            // Either a single ascending or a transformed descending run.
+            // Always check that a final run is a proper terminator, otherwise
+            // we have an unterminated trailing run, to handle downstream.
+            return;
+        }
+        right++;
+        if (run[count] < right) {
+            // Corner case: the final run is not a terminator. This may happen
+            // if a final run is an equals run, or there is a single-element run
+            // at the end. Fix up by adding a proper terminator at the end.
+            // Note that we terminate with (right + 1), incremented earlier.
             run[++count] = right;
-        } else if (count <= 1) { // The array is already sorted
-            return;
         }
 
         // Determine alternation base for merge
@@ -598,12 +612,26 @@
             }
         }
 
-        // Check special cases
-        // Implementation note: variable "right" is increased by 1.
-        if (run[count] == right++) { // The last run contains one element
+        // These invariants should hold true:
+        //    run[0] = 0
+        //    run[<last>] = right + 1; (terminator)
+
+        if (count == 0) {
+            // A single equal run
+            return;
+        } else if (count == 1 && run[count] > right) {
+            // Either a single ascending or a transformed descending run.
+            // Always check that a final run is a proper terminator, otherwise
+            // we have an unterminated trailing run, to handle downstream.
+            return;
+        }
+        right++;
+        if (run[count] < right) {
+            // Corner case: the final run is not a terminator. This may happen
+            // if a final run is an equals run, or there is a single-element run
+            // at the end. Fix up by adding a proper terminator at the end.
+            // Note that we terminate with (right + 1), incremented earlier.
             run[++count] = right;
-        } else if (count <= 1) { // The array is already sorted
-            return;
         }
 
         // Determine alternation base for merge
@@ -1086,12 +1114,26 @@
             }
         }
 
-        // Check special cases
-        // Implementation note: variable "right" is increased by 1.
-        if (run[count] == right++) { // The last run contains one element
+        // These invariants should hold true:
+        //    run[0] = 0
+        //    run[<last>] = right + 1; (terminator)
+
+        if (count == 0) {
+            // A single equal run
+            return;
+        } else if (count == 1 && run[count] > right) {
+            // Either a single ascending or a transformed descending run.
+            // Always check that a final run is a proper terminator, otherwise
+            // we have an unterminated trailing run, to handle downstream.
+            return;
+        }
+        right++;
+        if (run[count] < right) {
+            // Corner case: the final run is not a terminator. This may happen
+            // if a final run is an equals run, or there is a single-element run
+            // at the end. Fix up by adding a proper terminator at the end.
+            // Note that we terminate with (right + 1), incremented earlier.
             run[++count] = right;
-        } else if (count <= 1) { // The array is already sorted
-            return;
         }
 
         // Determine alternation base for merge
@@ -1574,12 +1616,26 @@
             }
         }
 
-        // Check special cases
-        // Implementation note: variable "right" is increased by 1.
-        if (run[count] == right++) { // The last run contains one element
+        // These invariants should hold true:
+        //    run[0] = 0
+        //    run[<last>] = right + 1; (terminator)
+
+        if (count == 0) {
+            // A single equal run
+            return;
+        } else if (count == 1 && run[count] > right) {
+            // Either a single ascending or a transformed descending run.
+            // Always check that a final run is a proper terminator, otherwise
+            // we have an unterminated trailing run, to handle downstream.
+            return;
+        }
+        right++;
+        if (run[count] < right) {
+            // Corner case: the final run is not a terminator. This may happen
+            // if a final run is an equals run, or there is a single-element run
+            // at the end. Fix up by adding a proper terminator at the end.
+            // Note that we terminate with (right + 1), incremented earlier.
             run[++count] = right;
-        } else if (count <= 1) { // The array is already sorted
-            return;
         }
 
         // Determine alternation base for merge
@@ -2158,12 +2214,26 @@
             }
         }
 
-        // Check special cases
-        // Implementation note: variable "right" is increased by 1.
-        if (run[count] == right++) { // The last run contains one element
+        // These invariants should hold true:
+        //    run[0] = 0
+        //    run[<last>] = right + 1; (terminator)
+
+        if (count == 0) {
+            // A single equal run
+            return;
+        } else if (count == 1 && run[count] > right) {
+            // Either a single ascending or a transformed descending run.
+            // Always check that a final run is a proper terminator, otherwise
+            // we have an unterminated trailing run, to handle downstream.
+            return;
+        }
+        right++;
+        if (run[count] < right) {
+            // Corner case: the final run is not a terminator. This may happen
+            // if a final run is an equals run, or there is a single-element run
+            // at the end. Fix up by adding a proper terminator at the end.
+            // Note that we terminate with (right + 1), incremented earlier.
             run[++count] = right;
-        } else if (count <= 1) { // The array is already sorted
-            return;
         }
 
         // Determine alternation base for merge
@@ -2701,12 +2771,26 @@
             }
         }
 
-        // Check special cases
-        // Implementation note: variable "right" is increased by 1.
-        if (run[count] == right++) { // The last run contains one element
+        // These invariants should hold true:
+        //    run[0] = 0
+        //    run[<last>] = right + 1; (terminator)
+
+        if (count == 0) {
+            // A single equal run
+            return;
+        } else if (count == 1 && run[count] > right) {
+            // Either a single ascending or a transformed descending run.
+            // Always check that a final run is a proper terminator, otherwise
+            // we have an unterminated trailing run, to handle downstream.
+            return;
+        }
+        right++;
+        if (run[count] < right) {
+            // Corner case: the final run is not a terminator. This may happen
+            // if a final run is an equals run, or there is a single-element run
+            // at the end. Fix up by adding a proper terminator at the end.
+            // Note that we terminate with (right + 1), incremented earlier.
             run[++count] = right;
-        } else if (count <= 1) { // The array is already sorted
-            return;
         }
 
         // Determine alternation base for merge
--- a/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java	Tue May 17 05:38:15 2016 -0700
@@ -68,13 +68,14 @@
         if (s != null && s.length() > 0)
             bcp = toURLClassPath(s);
 
-        // we have a class path if -cp is specified or -m is not specified
+        // we have a class path if -cp is specified or -m is not specified.
+        // If neither is specified then default to -cp <working directory>.
         URLClassPath ucp = null;
         String mainMid = System.getProperty("jdk.module.main");
         String cp = System.getProperty("java.class.path");
-        if (mainMid == null && (cp == null || cp.length() == 0))
-            cp = ".";
-        if (cp != null && cp.length() > 0)
+        if (mainMid == null && cp == null)
+            cp = "";
+        if (cp != null)
             ucp = toURLClassPath(cp);
 
 
@@ -197,7 +198,7 @@
          * @see java.lang.instrument.Instrumentation#appendToSystemClassLoaderSearch
          */
         void appendToClassPathForInstrumentation(String path) {
-            appendToUCP(path, ucp);
+            addClassPathToUCP(path, ucp);
         }
 
         /**
@@ -224,7 +225,7 @@
      */
     private static URLClassPath toURLClassPath(String cp) {
         URLClassPath ucp = new URLClassPath(new URL[0]);
-        appendToUCP(cp, ucp);
+        addClassPathToUCP(cp, ucp);
         return ucp;
     }
 
@@ -232,20 +233,28 @@
      * Converts the elements in the given class path to file URLs and adds
      * them to the given URLClassPath.
      */
-    private static void appendToUCP(String cp, URLClassPath ucp) {
-        String[] elements = cp.split(File.pathSeparator);
-        if (elements.length == 0) {
-            // contains path separator(s) only, default to current directory
-            // to be compatible with long standing behavior
-            elements = new String[] { "" };
+    private static void addClassPathToUCP(String cp, URLClassPath ucp) {
+        int off = 0;
+        int next;
+        while ((next = cp.indexOf(File.pathSeparator, off)) != -1) {
+            addURLToUCP(cp.substring(off, next), ucp);
+            off = next + 1;
         }
-        for (String s: elements) {
-            try {
-                URL url = Paths.get(s).toRealPath().toUri().toURL();
-                ucp.addURL(url);
-            } catch (InvalidPathException | IOException ignore) {
-                // malformed path string or class path element does not exist
-            }
+
+        // remaining
+        addURLToUCP(cp.substring(off), ucp);
+    }
+
+    /**
+     * Attempts to convert to the given string to a file URL and adds it
+     * to the given URLClassPath.
+     */
+    private static void addURLToUCP(String s, URLClassPath ucp) {
+        try {
+            URL url = Paths.get(s).toRealPath().toUri().toURL();
+            ucp.addURL(url);
+        } catch (InvalidPathException | IOException ignore) {
+            // malformed path string or class path element does not exist
         }
     }
 
--- a/src/java.base/share/classes/sun/security/provider/PolicyFile.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.base/share/classes/sun/security/provider/PolicyFile.java	Tue May 17 05:38:15 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -259,14 +259,10 @@
 
     private static final Debug debug = Debug.getInstance("policy");
 
-    private static final String NONE = "NONE";
-    private static final String P11KEYSTORE = "PKCS11";
-
     private static final String SELF = "${{self}}";
     private static final String X500PRINCIPAL =
                         "javax.security.auth.x500.X500Principal";
     private static final String POLICY = "java.security.policy";
-    private static final String SECURITY_MANAGER = "java.security.manager";
     private static final String POLICY_URL = "policy.url.";
     private static final String AUTH_POLICY = "java.security.auth.policy";
     private static final String AUTH_POLICY_URL = "auth.policy.url.";
@@ -288,6 +284,17 @@
     private static final Class<?>[] PARAMS2 = { String.class, String.class };
 
     /**
+     * When a policy file has a syntax error, the exception code may generate
+     * another permission check and this can cause the policy file to be parsed
+     * repeatedly, leading to a StackOverflowError or ClassCircularityError.
+     * To avoid this, this set is populated with policy files that have been
+     * previously parsed and have syntax errors, so that they can be
+     * subsequently ignored.
+     */
+    private static AtomicReference<Set<URL>> badPolicyURLs =
+        new AtomicReference<>(new HashSet<>());
+
+    /**
      * Initializes the Policy object and reads the default policy
      * configuration file(s) into the Policy object.
      */
@@ -580,6 +587,16 @@
      * @param policyFile the policy Reader object.
      */
     private boolean init(URL policy, PolicyInfo newInfo) {
+
+        // skip parsing policy file if it has been previously parsed and
+        // has syntax errors
+        if (badPolicyURLs.get().contains(policy)) {
+            if (debug != null) {
+                debug.println("skipping bad policy file: " + policy);
+            }
+            return false;
+        }
+
         boolean success = false;
         PolicyParser pp = new PolicyParser(expandProperties);
         InputStreamReader isr = null;
@@ -622,13 +639,18 @@
                 addGrantEntry(ge, keyStore, newInfo);
             }
         } catch (PolicyParser.ParsingException pe) {
+            // record bad policy file to avoid later reparsing it
+            badPolicyURLs.updateAndGet(k -> {
+                k.add(policy);
+                return k;
+            });
             MessageFormat form = new MessageFormat(ResourcesMgr.getString
                 (POLICY + ".error.parsing.policy.message"));
             Object[] source = {policy, pe.getLocalizedMessage()};
             System.err.println(form.format(source));
-            if (debug != null)
+            if (debug != null) {
                 pe.printStackTrace();
-
+            }
         } catch (Exception e) {
             if (debug != null) {
                 debug.println("error parsing "+policy);
--- a/src/java.base/share/classes/sun/security/provider/PolicyParser.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.base/share/classes/sun/security/provider/PolicyParser.java	Tue May 17 05:38:15 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -213,7 +213,9 @@
                             new MessageFormat(ResourcesMgr.getString(
                                 "duplicate.keystore.domain.name"));
                         Object[] source = {domainName};
-                        throw new ParsingException(form.format(source));
+                        String msg = "duplicate keystore domain name: " +
+                                     domainName;
+                        throw new ParsingException(msg, form, source);
                     }
                 }
             } else {
@@ -743,7 +745,8 @@
                     ResourcesMgr.getString
                             ("expected.expect.read.end.of.file."));
             Object[] source = {expect};
-            throw new ParsingException(form.format(source));
+            String msg = "expected [" + expect + "], read [end of file]";
+            throw new ParsingException(msg, form, source);
         case StreamTokenizer.TT_WORD:
             if (expect.equalsIgnoreCase(st.sval)) {
                 lookahead = st.nextToken();
@@ -1244,7 +1247,8 @@
                 MessageFormat form = new MessageFormat(ResourcesMgr.getString(
                     "duplicate.keystore.name"));
                 Object[] source = {keystoreName};
-                throw new ParsingException(form.format(source));
+                String msg = "duplicate keystore name: " + keystoreName;
+                throw new ParsingException(msg, form, source);
             }
         }
 
@@ -1316,6 +1320,8 @@
         private static final long serialVersionUID = -4330692689482574072L;
 
         private String i18nMessage;
+        private MessageFormat form;
+        private Object[] source;
 
         /**
          * Constructs a ParsingException with the specified
@@ -1330,26 +1336,34 @@
             i18nMessage = msg;
         }
 
+        public ParsingException(String msg, MessageFormat form,
+                                Object[] source) {
+            super(msg);
+            this.form = form;
+            this.source = source;
+        }
+
         public ParsingException(int line, String msg) {
             super("line " + line + ": " + msg);
-            MessageFormat form = new MessageFormat
-                (ResourcesMgr.getString("line.number.msg"));
-            Object[] source = {line, msg};
-            i18nMessage = form.format(source);
+            // don't call form.format unless getLocalizedMessage is called
+            // to avoid unnecessary permission checks
+            form = new MessageFormat(ResourcesMgr.getString("line.number.msg"));
+            source = new Object[] {line, msg};
         }
 
         public ParsingException(int line, String expect, String actual) {
             super("line " + line + ": expected [" + expect +
                 "], found [" + actual + "]");
-            MessageFormat form = new MessageFormat(ResourcesMgr.getString
+            // don't call form.format unless getLocalizedMessage is called
+            // to avoid unnecessary permission checks
+            form = new MessageFormat(ResourcesMgr.getString
                 ("line.number.expected.expect.found.actual."));
-            Object[] source = {line, expect, actual};
-            i18nMessage = form.format(source);
+            source = new Object[] {line, expect, actual};
         }
 
         @Override
         public String getLocalizedMessage() {
-            return i18nMessage;
+            return i18nMessage != null ? i18nMessage : form.format(source);
         }
     }
 
--- a/src/java.httpclient/share/classes/java/net/http/HttpClientImpl.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.httpclient/share/classes/java/net/http/HttpClientImpl.java	Tue May 17 05:38:15 2016 -0700
@@ -35,6 +35,7 @@
 import java.nio.channels.SelectableChannel;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
+import java.nio.channels.SocketChannel;
 import java.security.NoSuchAlgorithmException;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -155,6 +156,15 @@
         selmgr.register(exchange);
     }
 
+    /**
+     * Only used from RawChannel to disconnect the channel from
+     * the selector
+     */
+    void cancelRegistration(SocketChannel s) {
+        selmgr.cancel(s);
+    }
+
+
     Http2ClientImpl client2() {
         return client2;
     }
@@ -220,6 +230,13 @@
             selector.wakeup();
         }
 
+        synchronized void cancel(SocketChannel e) {
+            SelectionKey key = e.keyFor(selector);
+            if (key != null)
+                key.cancel();
+            selector.wakeup();
+        }
+
         void wakeupSelector() {
             selector.wakeup();
         }
--- a/src/java.httpclient/share/classes/java/net/http/HttpHeaders1.java	Sat May 14 09:11:07 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- */
-
-package java.net.http;
-
-public interface HttpHeaders1 extends HttpHeaders {
-    public void makeUnmodifiable();
-}
--- a/src/java.httpclient/share/classes/java/net/http/HttpResponseImpl.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.httpclient/share/classes/java/net/http/HttpResponseImpl.java	Tue May 17 05:38:15 2016 -0700
@@ -176,7 +176,7 @@
      *
      * @return
      */
-    RawChannel rawChannel() {
+    RawChannel rawChannel() throws IOException {
         if (rawchan == null) {
             rawchan = new RawChannel(request.client(), connection);
         }
--- a/src/java.httpclient/share/classes/java/net/http/RawChannel.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.httpclient/share/classes/java/net/http/RawChannel.java	Tue May 17 05:38:15 2016 -0700
@@ -29,6 +29,7 @@
 import java.nio.channels.GatheringByteChannel;
 import java.nio.channels.SelectableChannel;
 import java.nio.channels.SelectionKey;
+import java.nio.channels.SocketChannel;
 
 //
 // Used to implement WebSocket. Each RawChannel corresponds to a TCP connection
@@ -56,9 +57,21 @@
     interface NonBlockingEvent extends RawEvent {
     }
 
-    RawChannel(HttpClientImpl client, HttpConnection connection) {
+    RawChannel(HttpClientImpl client, HttpConnection connection)
+                                                throws IOException {
         this.client = client;
         this.connection = connection;
+        SocketChannel chan = connection.channel();
+        client.cancelRegistration(chan);
+        chan.configureBlocking(false);
+    }
+
+    SocketChannel socketChannel() {
+        return connection.channel();
+    }
+
+    ByteBuffer getRemaining() {
+        return connection.getRemaining();
     }
 
     private class RawAsyncEvent extends AsyncEvent {
--- a/src/java.httpclient/share/classes/java/net/http/WSOpeningHandshake.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/java.httpclient/share/classes/java/net/http/WSOpeningHandshake.java	Tue May 17 05:38:15 2016 -0700
@@ -24,6 +24,8 @@
  */
 package java.net.http;
 
+import java.io.UncheckedIOException;
+import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.nio.charset.StandardCharsets;
@@ -126,6 +128,8 @@
                         return CompletableFuture.completedFuture(result);
                     } catch (WebSocketHandshakeException e) {
                         return CompletableFuture.failedFuture(e);
+                    } catch (UncheckedIOException ee) {
+                        return CompletableFuture.failedFuture(ee.getCause());
                     }
                 });
     }
@@ -149,7 +153,12 @@
         checkAccept(response, h);
         checkExtensions(response, h);
         String subprotocol = checkAndReturnSubprotocol(response, h);
-        RawChannel channel = ((HttpResponseImpl) response).rawChannel();
+        RawChannel channel = null;
+        try {
+            channel = ((HttpResponseImpl) response).rawChannel();
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
         return new Result(subprotocol, channel);
     }
 
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/Jlink.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/Jlink.java	Tue May 17 05:38:15 2016 -0700
@@ -34,11 +34,9 @@
 import java.util.Set;
 import jdk.tools.jlink.internal.JlinkTask;
 import jdk.tools.jlink.plugin.Plugin;
-import jdk.tools.jlink.plugin.PluginContext;
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.ExecutableImage;
 import jdk.tools.jlink.builder.ImageBuilder;
-import jdk.tools.jlink.internal.PluginContextImpl;
 import jdk.tools.jlink.internal.PluginRepository;
 
 /**
@@ -71,7 +69,6 @@
         private final List<Plugin> plugins;
         private final ImageBuilder imageBuilder;
         private final String lastSorterPluginName;
-        private final PluginContext pluginContext;
 
         /**
          * Empty plugins configuration.
@@ -86,7 +83,7 @@
          * @param plugins List of plugins.
          */
         public PluginsConfiguration(List<Plugin> plugins) {
-            this(plugins, null, null, null);
+            this(plugins, null, null);
         }
 
         /**
@@ -101,28 +98,10 @@
          */
         public PluginsConfiguration(List<Plugin> plugins,
                 ImageBuilder imageBuilder, String lastSorterPluginName) {
-            this(plugins, imageBuilder, lastSorterPluginName, null);
-        }
-
-        /**
-         * Plugins configuration with a last sorter and an ImageBuilder. No
-         * sorting can occur after the last sorter plugin. The ImageBuilder is
-         * in charge to layout the image content on disk.
-         *
-         * @param plugins List of transformer plugins.
-         * @param imageBuilder Image builder.
-         * @param lastSorterPluginName Name of last sorter plugin, no sorting
-         * @param ctx the plugin context
-         * can occur after it.
-         */
-        public PluginsConfiguration(List<Plugin> plugins,
-                ImageBuilder imageBuilder, String lastSorterPluginName,
-                PluginContext ctx) {
             this.plugins = plugins == null ? Collections.emptyList()
                     : plugins;
             this.imageBuilder = imageBuilder;
             this.lastSorterPluginName = lastSorterPluginName;
-            this.pluginContext = ctx != null? ctx : new PluginContextImpl();
         }
 
         /**
@@ -146,13 +125,6 @@
             return lastSorterPluginName;
         }
 
-        /**
-         * @return the pluginContext
-         */
-        public PluginContext getPluginContext() {
-            return pluginContext;
-        }
-
         @Override
         public String toString() {
             StringBuilder builder = new StringBuilder();
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java	Tue May 17 05:38:15 2016 -0700
@@ -1,3 +1,4 @@
+
 /*
  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,8 +25,6 @@
  */
 package jdk.tools.jlink.builder;
 
-import jdk.tools.jlink.plugin.ExecutableImage;
-import jdk.tools.jlink.plugin.PluginException;
 import java.io.BufferedOutputStream;
 import java.io.BufferedWriter;
 import java.io.ByteArrayInputStream;
@@ -47,8 +46,10 @@
 import java.nio.file.attribute.PosixFileAttributeView;
 import java.nio.file.attribute.PosixFilePermission;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.Properties;
@@ -56,23 +57,40 @@
 import jdk.tools.jlink.internal.BasicImageWriter;
 import jdk.tools.jlink.internal.plugins.FileCopierPlugin;
 import jdk.tools.jlink.internal.plugins.FileCopierPlugin.SymImageFile;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.Module;
-import jdk.tools.jlink.plugin.Pool.ModuleData;
+import jdk.tools.jlink.plugin.ExecutableImage;
+import jdk.tools.jlink.plugin.ModulePool;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.PluginException;
 
 /**
  *
  * Default Image Builder. This builder creates the default runtime image layout.
  */
-public class DefaultImageBuilder implements ImageBuilder {
+public final class DefaultImageBuilder implements ImageBuilder {
 
     /**
      * The default java executable Image.
      */
-    static class DefaultExecutableImage extends ExecutableImage {
+    static final class DefaultExecutableImage implements ExecutableImage {
+
+        private final Path home;
+        private final List<String> args;
+        private final Set<String> modules;
 
         public DefaultExecutableImage(Path home, Set<String> modules) {
-            super(home, modules, createArgs(home));
+            this(home, modules, createArgs(home));
+        }
+
+        private DefaultExecutableImage(Path home, Set<String> modules,
+                List<String> args) {
+            Objects.requireNonNull(home);
+            Objects.requireNonNull(args);
+            if (!Files.exists(home)) {
+                throw new IllegalArgumentException("Invalid image home");
+            }
+            this.home = home;
+            this.modules = Collections.unmodifiableSet(modules);
+            this.args = Collections.unmodifiableList(args);
         }
 
         private static List<String> createArgs(Path home) {
@@ -84,6 +102,21 @@
         }
 
         @Override
+        public Path getHome() {
+            return home;
+        }
+
+        @Override
+        public Set<String> getModules() {
+            return modules;
+        }
+
+        @Override
+        public List<String> getExecutionArgs() {
+            return args;
+        }
+
+        @Override
         public void storeLaunchArgs(List<String> args) {
             try {
                 patchScripts(this, args);
@@ -111,17 +144,19 @@
         Files.createDirectories(mdir);
     }
 
-    private void storeFiles(Set<String> modules, Properties release) throws IOException {
+    private void storeFiles(Set<String> modules, Map<String, String> release) throws IOException {
         if (release != null) {
-            addModules(release, modules);
+            Properties props = new Properties();
+            props.putAll(release);
+            addModules(props, modules);
             File r = new File(root.toFile(), "release");
             try (FileOutputStream fo = new FileOutputStream(r)) {
-                release.store(fo, null);
+                props.store(fo, null);
             }
         }
     }
 
-    private void addModules(Properties release, Set<String> modules) throws IOException {
+    private void addModules(Properties props, Set<String> modules) throws IOException {
         StringBuilder builder = new StringBuilder();
         int i = 0;
         for (String m : modules) {
@@ -131,28 +166,32 @@
             }
             i++;
         }
-        release.setProperty("MODULES", builder.toString());
+        props.setProperty("MODULES", builder.toString());
     }
 
     @Override
-    public void storeFiles(Pool files, Properties release) {
+    public void storeFiles(ModulePool files) {
         try {
-            for (ModuleData f : files.getContent()) {
-               if (!f.getType().equals(Pool.ModuleDataType.CLASS_OR_RESOURCE)) {
-                    accept(f);
+            files.entries().forEach(f -> {
+                if (!f.getType().equals(ModuleEntry.Type.CLASS_OR_RESOURCE)) {
+                    try {
+                        accept(f);
+                    } catch (IOException ioExp) {
+                        throw new UncheckedIOException(ioExp);
+                    }
                 }
-            }
-            for (Module m : files.getModules()) {
+            });
+            files.modules().forEach(m -> {
                 // Only add modules that contain packages
                 if (!m.getAllPackages().isEmpty()) {
                     // Skip the fake module used by FileCopierPlugin when copying files.
                     if (m.getName().equals(FileCopierPlugin.FAKE_MODULE)) {
-                       continue;
+                        return;
                     }
                     modules.add(m.getName());
                 }
-            }
-            storeFiles(modules, release);
+            });
+            storeFiles(modules, files.getReleaseProperties());
 
             if (Files.getFileStore(root).supportsFileAttributeView(PosixFileAttributeView.class)) {
                 // launchers in the bin directory need execute permission
@@ -168,8 +207,8 @@
                 Path lib = root.resolve("lib");
                 if (Files.isDirectory(lib)) {
                     Files.find(lib, 2, (path, attrs) -> {
-                        return path.getFileName().toString().equals("jspawnhelper") ||
-                               path.getFileName().toString().equals("jexec");
+                        return path.getFileName().toString().equals("jspawnhelper")
+                                || path.getFileName().toString().equals("jexec");
                     }).forEach(this::setExecutable);
                 }
             }
@@ -180,27 +219,23 @@
         }
     }
 
-    @Override
-    public void storeFiles(Pool files) {
-        storeFiles(files, new Properties());
-    }
-
     /**
      * Generates launcher scripts.
+     *
      * @param imageContent The image content.
      * @param modules The set of modules that the runtime image contains.
      * @throws IOException
      */
-    protected void prepareApplicationFiles(Pool imageContent, Set<String> modules) throws IOException {
+    protected void prepareApplicationFiles(ModulePool imageContent, Set<String> modules) throws IOException {
         // generate launch scripts for the modules with a main class
         for (String module : modules) {
             String path = "/" + module + "/module-info.class";
-            ModuleData res = imageContent.get(path);
-            if (res == null) {
+            Optional<ModuleEntry> res = imageContent.findEntry(path);
+            if (!res.isPresent()) {
                 throw new IOException("module-info.class not found for " + module + " module");
             }
             Optional<String> mainClass;
-            ByteArrayInputStream stream = new ByteArrayInputStream(res.getBytes());
+            ByteArrayInputStream stream = new ByteArrayInputStream(res.get().getBytes());
             mainClass = ModuleDescriptor.read(stream).mainClass();
             if (mainClass.isPresent()) {
                 Path cmd = root.resolve("bin").resolve(module);
@@ -263,9 +298,9 @@
         }
     }
 
-    private void accept(ModuleData file) throws IOException {
+    private void accept(ModuleEntry file) throws IOException {
         String fullPath = file.getPath();
-        String module = "/" + file.getModule()+ "/";
+        String module = "/" + file.getModule() + "/";
         String filename = fullPath.substring(module.length());
         // Remove radical native|config|...
         filename = filename.substring(filename.indexOf('/') + 1);
@@ -404,8 +439,7 @@
 
     public static ExecutableImage getExecutableImage(Path root) {
         if (Files.exists(root.resolve("bin").resolve(getJavaProcessName()))) {
-            return new DefaultImageBuilder.DefaultExecutableImage(root,
-                    retrieveModules(root));
+            return new DefaultExecutableImage(root, retrieveModules(root));
         }
         return null;
     }
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/ImageBuilder.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/ImageBuilder.java	Tue May 17 05:38:15 2016 -0700
@@ -29,7 +29,7 @@
 
 import jdk.tools.jlink.plugin.ExecutableImage;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
+import jdk.tools.jlink.plugin.ModulePool;
 
 /**
  * Implement this interface to develop your own image layout. First the jimage
@@ -45,7 +45,7 @@
      * @param release the release properties
      * @throws PluginException
      */
-    public default void storeFiles(Pool content, Properties release) {
+    public default void storeFiles(ModulePool content, Properties release) {
         storeFiles(content);
     }
 
@@ -55,7 +55,7 @@
      * @param content Pool of module content.
      * @throws PluginException
      */
-    public default void storeFiles(Pool content) {
+    public default void storeFiles(ModulePool content) {
         throw new UnsupportedOperationException("storeFiles");
     }
 
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java	Tue May 17 05:38:15 2016 -0700
@@ -44,12 +44,11 @@
 import java.util.stream.Stream;
 import jdk.tools.jlink.internal.Archive.Entry;
 import jdk.tools.jlink.internal.Archive.Entry.EntryType;
-import jdk.tools.jlink.internal.PoolImpl.CompressedModuleData;
+import jdk.tools.jlink.internal.ModulePoolImpl.CompressedModuleData;
 import jdk.tools.jlink.plugin.ExecutableImage;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleData;
-import jdk.tools.jlink.plugin.Pool.ModuleDataType;
+import jdk.tools.jlink.plugin.ModulePool;
+import jdk.tools.jlink.plugin.ModuleEntry;
 
 /**
  * An image (native endian.)
@@ -145,7 +144,7 @@
                                     }));
             ByteOrder order = ByteOrder.nativeOrder();
             BasicImageWriter writer = new BasicImageWriter(order);
-            PoolImpl pool = createPools(archives, entriesForModule, order, writer);
+            ModulePoolImpl pool = createPools(archives, entriesForModule, order, writer);
             try (OutputStream fos = Files.newOutputStream(jimageFile);
                     BufferedOutputStream bos = new BufferedOutputStream(fos);
                     DataOutputStream out = new DataOutputStream(bos)) {
@@ -163,9 +162,9 @@
             ByteOrder byteOrder)
             throws IOException {
         BasicImageWriter writer = new BasicImageWriter(byteOrder);
-        PoolImpl allContent = createPools(archives,
+        ModulePoolImpl allContent = createPools(archives,
                 entriesForModule, byteOrder, writer);
-        PoolImpl result = generateJImage(allContent,
+        ModulePoolImpl result = generateJImage(allContent,
              writer, plugins, plugins.getJImageFileOutputStream());
 
         //Handle files.
@@ -176,12 +175,12 @@
         }
     }
 
-    private static PoolImpl generateJImage(PoolImpl allContent,
+    private static ModulePoolImpl generateJImage(ModulePoolImpl allContent,
             BasicImageWriter writer,
             ImagePluginStack pluginSupport,
             DataOutputStream out
     ) throws IOException {
-        PoolImpl resultResources;
+        ModulePoolImpl resultResources;
         try {
             resultResources = pluginSupport.visitResources(allContent);
         } catch (PluginException pe) {
@@ -190,14 +189,14 @@
             throw new IOException(ex);
         }
         Set<String> duplicates = new HashSet<>();
-        long offset = 0;
+        long[] offset = new long[1];
 
-        List<ModuleData> content = new ArrayList<>();
+        List<ModuleEntry> content = new ArrayList<>();
         List<String> paths = new ArrayList<>();
                  // the order of traversing the resources and the order of
         // the module content being written must be the same
-        for (ModuleData res : resultResources.getContent()) {
-            if (res.getType().equals(ModuleDataType.CLASS_OR_RESOURCE)) {
+        resultResources.entries().forEach(res -> {
+            if (res.getType().equals(ModuleEntry.Type.CLASS_OR_RESOURCE)) {
                 String path = res.getPath();
                 content.add(res);
                 long uncompressedSize = res.getLength();
@@ -216,24 +215,24 @@
                     // TODO Need to hang bytes on resource and write
                     // from resource not zip.
                     // Skipping resource throws off writing from zip.
-                    offset += onFileSize;
-                    continue;
+                    offset[0] += onFileSize;
+                    return;
                 }
                 duplicates.add(path);
-                writer.addLocation(path, offset, compressedSize, uncompressedSize);
+                writer.addLocation(path, offset[0], compressedSize, uncompressedSize);
                 paths.add(path);
-                offset += onFileSize;
+                offset[0] += onFileSize;
             }
-        }
+        });
 
-        ImageResourcesTree tree = new ImageResourcesTree(offset, writer, paths);
+        ImageResourcesTree tree = new ImageResourcesTree(offset[0], writer, paths);
 
         // write header and indices
         byte[] bytes = writer.getBytes();
         out.write(bytes, 0, bytes.length);
 
         // write module content
-        for (ModuleData res : content) {
+        for (ModuleEntry res : content) {
             byte[] buf = res.getBytes();
             out.write(buf, 0, buf.length);
         }
@@ -245,26 +244,26 @@
         return resultResources;
     }
 
-    private static Pool.ModuleDataType mapImageFileType(EntryType type) {
+    private static ModuleEntry.Type mapImageFileType(EntryType type) {
         switch(type) {
             case CONFIG: {
-                return Pool.ModuleDataType.CONFIG;
+                return ModuleEntry.Type.CONFIG;
             }
             case NATIVE_CMD: {
-                return Pool.ModuleDataType.NATIVE_CMD;
+                return ModuleEntry.Type.NATIVE_CMD;
             }
             case NATIVE_LIB: {
-                return Pool.ModuleDataType.NATIVE_LIB;
+                return ModuleEntry.Type.NATIVE_LIB;
             }
         }
         return null;
     }
 
-    private static PoolImpl createPools(Set<Archive> archives,
+    private static ModulePoolImpl createPools(Set<Archive> archives,
             Map<String, List<Entry>> entriesForModule,
             ByteOrder byteOrder,
             BasicImageWriter writer) throws IOException {
-        PoolImpl resources = new PoolImpl(byteOrder, new StringTable() {
+        ModulePoolImpl resources = new ModulePoolImpl(byteOrder, new StringTable() {
 
             @Override
             public int addString(String str) {
@@ -291,7 +290,7 @@
                             path = "/" + mn + "/" + path;
                         }
                         try {
-                            resources.add(Pool.newResource(path, bytes));
+                            resources.add(ModuleEntry.create(path, bytes));
                         } catch (Exception ex) {
                             throw new IOException(ex);
                         }
@@ -300,7 +299,7 @@
                     try {
                         // Entry.path() contains the kind of file native, conf, bin, ...
                         // Keep it to avoid naming conflict (eg: native/jvm.cfg and config/jvm.cfg
-                        resources.add(Pool.newImageFile(mn,
+                        resources.add(ModuleEntry.create(mn,
                                 "/" + mn + "/" + entry.path(), mapImageFileType(entry.type()),
                                 entry.stream(), entry.size()));
                     } catch (Exception ex) {
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java	Tue May 17 05:38:15 2016 -0700
@@ -28,22 +28,17 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.Objects;
-import java.util.Properties;
 import jdk.tools.jlink.plugin.ExecutableImage;
 import jdk.tools.jlink.builder.ImageBuilder;
 import jdk.tools.jlink.Jlink;
 import jdk.tools.jlink.plugin.Plugin;
-import jdk.tools.jlink.plugin.PluginContext;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Plugin.CATEGORY;
-import jdk.tools.jlink.plugin.Pool;
+import jdk.tools.jlink.plugin.Plugin.Category;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.PostProcessorPlugin;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 
@@ -52,17 +47,18 @@
  */
 public final class ImagePluginConfiguration {
 
-    private static final List<Plugin.CATEGORY> CATEGORIES_ORDER = new ArrayList<>();
+    private static final List<Plugin.Category> CATEGORIES_ORDER = new ArrayList<>();
 
     static {
-        CATEGORIES_ORDER.add(Plugin.CATEGORY.FILTER);
-        CATEGORIES_ORDER.add(Plugin.CATEGORY.TRANSFORMER);
-        CATEGORIES_ORDER.add(Plugin.CATEGORY.MODULEINFO_TRANSFORMER);
-        CATEGORIES_ORDER.add(Plugin.CATEGORY.SORTER);
-        CATEGORIES_ORDER.add(Plugin.CATEGORY.COMPRESSOR);
-        CATEGORIES_ORDER.add(Plugin.CATEGORY.VERIFIER);
-        CATEGORIES_ORDER.add(Plugin.CATEGORY.PROCESSOR);
-        CATEGORIES_ORDER.add(Plugin.CATEGORY.PACKAGER);
+        CATEGORIES_ORDER.add(Plugin.Category.FILTER);
+        CATEGORIES_ORDER.add(Plugin.Category.TRANSFORMER);
+        CATEGORIES_ORDER.add(Plugin.Category.MODULEINFO_TRANSFORMER);
+        CATEGORIES_ORDER.add(Plugin.Category.SORTER);
+        CATEGORIES_ORDER.add(Plugin.Category.COMPRESSOR);
+        CATEGORIES_ORDER.add(Plugin.Category.METAINFO_ADDER);
+        CATEGORIES_ORDER.add(Plugin.Category.VERIFIER);
+        CATEGORIES_ORDER.add(Plugin.Category.PROCESSOR);
+        CATEGORIES_ORDER.add(Plugin.Category.PACKAGER);
     }
 
     private ImagePluginConfiguration() {
@@ -76,8 +72,8 @@
         if (pluginsConfiguration == null) {
             return new ImagePluginStack();
         }
-        Map<Plugin.CATEGORY, List<Plugin>> plugins = new LinkedHashMap<>();
-        for (Plugin.CATEGORY cat : CATEGORIES_ORDER) {
+        Map<Plugin.Category, List<Plugin>> plugins = new LinkedHashMap<>();
+        for (Plugin.Category cat : CATEGORIES_ORDER) {
             plugins.put(cat, new ArrayList<>());
         }
 
@@ -89,7 +85,7 @@
                         + " added more than once to stack ");
             }
             seen.add(plug.getName());
-            CATEGORY category = Utils.getCategory(plug);
+            Category category = Utils.getCategory(plug);
             if (category == null) {
                 throw new PluginException("Invalid category for "
                         + plug.getName());
@@ -100,10 +96,10 @@
 
         List<TransformerPlugin> transformerPlugins = new ArrayList<>();
         List<PostProcessorPlugin> postProcessingPlugins = new ArrayList<>();
-        for (Entry<Plugin.CATEGORY, List<Plugin>> entry : plugins.entrySet()) {
+        for (Entry<Plugin.Category, List<Plugin>> entry : plugins.entrySet()) {
             // Sort according to plugin constraints
             List<Plugin> orderedPlugins = PluginOrderingGraph.sort(entry.getValue());
-            CATEGORY category = entry.getKey();
+            Category category = entry.getKey();
             for (Plugin p : orderedPlugins) {
                 if (Utils.isPostProcessor(category)) {
                     @SuppressWarnings("unchecked")
@@ -143,14 +139,13 @@
                 }
 
                 @Override
-                public void storeFiles(Pool files) {
+                public void storeFiles(ModulePool files) {
                     throw new PluginException("No directory setup to store files");
                 }
             };
         }
 
-        PluginContext ctxt = pluginsConfiguration.getPluginContext();
         return new ImagePluginStack(builder, transformerPlugins,
-                lastSorter, postProcessingPlugins, ctxt);
+                lastSorter, postProcessingPlugins);
     }
 }
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java	Tue May 17 05:38:15 2016 -0700
@@ -37,20 +37,21 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Properties;
+import java.util.Optional;
 import java.util.Set;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 import jdk.internal.jimage.decompressor.Decompressor;
 import jdk.tools.jlink.plugin.Plugin;
-import jdk.tools.jlink.plugin.PluginContext;
 import jdk.tools.jlink.plugin.ExecutableImage;
 import jdk.tools.jlink.builder.ImageBuilder;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleData;
+import jdk.tools.jlink.plugin.ModulePool;
+import jdk.tools.jlink.plugin.LinkModule;
+import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.PostProcessorPlugin;
 
 /**
@@ -64,9 +65,9 @@
         ExecutableImage retrieve(ImagePluginStack stack) throws IOException;
     }
 
-    public static final class OrderedResourcePool extends PoolImpl {
+    public static final class OrderedResourcePool extends ModulePoolImpl {
 
-        private final List<ModuleData> orderedList = new ArrayList<>();
+        private final List<ModuleEntry> orderedList = new ArrayList<>();
 
         public OrderedResourcePool(ByteOrder order, StringTable table) {
             super(order, table);
@@ -78,22 +79,22 @@
          * @param resource The Resource to add.
          */
         @Override
-        public void add(ModuleData resource) {
+        public void add(ModuleEntry resource) {
             super.add(resource);
             orderedList.add(resource);
         }
 
-        List<ModuleData> getOrderedList() {
+        List<ModuleEntry> getOrderedList() {
             return Collections.unmodifiableList(orderedList);
         }
     }
 
-    private final static class CheckOrderResourcePool extends PoolImpl {
+    private final static class CheckOrderResourcePool extends ModulePoolImpl {
 
-        private final List<ModuleData> orderedList;
+        private final List<ModuleEntry> orderedList;
         private int currentIndex;
 
-        public CheckOrderResourcePool(ByteOrder order, List<ModuleData> orderedList, StringTable table) {
+        public CheckOrderResourcePool(ByteOrder order, List<ModuleEntry> orderedList, StringTable table) {
             super(order, table);
             this.orderedList = orderedList;
         }
@@ -104,8 +105,8 @@
          * @param resource The Resource to add.
          */
         @Override
-        public void add(ModuleData resource) {
-            ModuleData ordered = orderedList.get(currentIndex);
+        public void add(ModuleEntry resource) {
+            ModuleEntry ordered = orderedList.get(currentIndex);
             if (!resource.equals(ordered)) {
                 throw new PluginException("Resource " + resource.getPath() + " not in the right order");
             }
@@ -166,26 +167,16 @@
     private final List<ResourcePrevisitor> resourcePrevisitors = new ArrayList<>();
 
     private final ImageBuilder imageBuilder;
-    private final Properties release;
 
     public ImagePluginStack() {
         this(null, Collections.emptyList(), null,
-                Collections.emptyList(), null);
+                Collections.emptyList());
     }
 
     public ImagePluginStack(ImageBuilder imageBuilder,
             List<TransformerPlugin> contentPlugins,
             Plugin lastSorter,
             List<PostProcessorPlugin> postprocessingPlugins) {
-        this(imageBuilder, contentPlugins, lastSorter,
-            postprocessingPlugins, null);
-    }
-
-    public ImagePluginStack(ImageBuilder imageBuilder,
-            List<TransformerPlugin> contentPlugins,
-            Plugin lastSorter,
-            List<PostProcessorPlugin> postprocessingPlugins,
-            PluginContext ctxt) {
         Objects.requireNonNull(contentPlugins);
         this.lastSorter = lastSorter;
         for (TransformerPlugin p : contentPlugins) {
@@ -200,7 +191,6 @@
             this.postProcessingPlugins.add(p);
         }
         this.imageBuilder = imageBuilder;
-        this.release = ctxt != null? ctxt.getReleaseProperties() : new Properties();
     }
 
     public void operate(ImageProvider provider) throws Exception {
@@ -231,12 +221,12 @@
      * @return The result of the visit.
      * @throws IOException
      */
-    public PoolImpl visitResources(PoolImpl resources)
+    public ModulePoolImpl visitResources(ModulePoolImpl resources)
             throws Exception {
         Objects.requireNonNull(resources);
         resources.setReadOnly();
         if (resources.isEmpty()) {
-            return new PoolImpl(resources.getByteOrder(),
+            return new ModulePoolImpl(resources.getByteOrder(),
                     resources.getStringTable());
         }
         PreVisitStrings previsit = new PreVisitStrings();
@@ -250,11 +240,11 @@
             resources.getStringTable().addString(s);
         }
 
-        PoolImpl current = resources;
-        List<Pool.ModuleData> frozenOrder = null;
+        ModulePoolImpl current = resources;
+        List<ModuleEntry> frozenOrder = null;
         for (TransformerPlugin p : contentPlugins) {
             current.setReadOnly();
-            PoolImpl output = null;
+            ModulePoolImpl output = null;
             if (p == lastSorter) {
                 if (frozenOrder != null) {
                     throw new Exception("Order of resources is already frozen. Plugin "
@@ -268,7 +258,7 @@
                     output = new CheckOrderResourcePool(current.getByteOrder(),
                             frozenOrder, resources.getStringTable());
                 } else {
-                    output = new PoolImpl(current.getByteOrder(),
+                    output = new ModulePoolImpl(current.getByteOrder(),
                             resources.getStringTable());
                 }
             }
@@ -287,15 +277,15 @@
     }
 
     /**
-     * This pool wrap the original pool and automatically uncompress moduledata
+     * This pool wrap the original pool and automatically uncompress ModuleEntry
      * if needed.
      */
-    private class LastPool extends Pool {
-        private class LastModule implements Module {
+    private class LastPool implements ModulePool {
+        private class LastModule implements LinkModule {
 
-            private final Module module;
+            final LinkModule module;
 
-            LastModule(Module module) {
+            LastModule(LinkModule module) {
                 this.module = module;
             }
 
@@ -305,9 +295,9 @@
             }
 
             @Override
-            public ModuleData get(String path) {
-                ModuleData d = module.get(path);
-                return getUncompressed(d);
+            public Optional<ModuleEntry> findEntry(String path) {
+                Optional<ModuleEntry> d = module.findEntry(path);
+                return d.isPresent()? Optional.of(getUncompressed(d.get())) : Optional.empty();
             }
 
             @Override
@@ -316,7 +306,7 @@
             }
 
             @Override
-            public void add(ModuleData data) {
+            public void add(ModuleEntry data) {
                 throw new PluginException("pool is readonly");
             }
 
@@ -331,19 +321,24 @@
             }
 
             @Override
-            public Collection<ModuleData> getContent() {
-                List<ModuleData> lst = new ArrayList<>();
-                for(ModuleData md : module.getContent()) {
+            public Stream<ModuleEntry> entries() {
+                List<ModuleEntry> lst = new ArrayList<>();
+                module.entries().forEach(md -> {
                     lst.add(getUncompressed(md));
-                }
-                return lst;
+                });
+                return lst.stream();
+            }
+
+            @Override
+            public int getEntryCount() {
+                return module.getEntryCount();
             }
         }
-        private final PoolImpl pool;
+        private final ModulePoolImpl pool;
         Decompressor decompressor = new Decompressor();
-        Collection<ModuleData> content;
+        Collection<ModuleEntry> content;
 
-        LastPool(PoolImpl pool) {
+        LastPool(ModulePoolImpl pool) {
             this.pool = pool;
         }
 
@@ -353,23 +348,14 @@
         }
 
         @Override
-        public void add(ModuleData resource) {
+        public void add(ModuleEntry resource) {
             throw new PluginException("pool is readonly");
         }
 
-        /**
-         * Retrieves the module of the provided name.
-         *
-         * @param name The module name
-         * @return the module or null if the module doesn't exist.
-         */
         @Override
-        public Module getModule(String name) {
-            Module module = pool.getModule(name);
-            if (module != null) {
-                module = new LastModule(module);
-            }
-            return module;
+        public Optional<LinkModule> findModule(String name) {
+            Optional<LinkModule> module = pool.findModule(name);
+            return module.isPresent()? Optional.of(new LastModule(module.get())) : Optional.empty();
         }
 
         /**
@@ -378,45 +364,55 @@
          * @return The collection of modules.
          */
         @Override
-        public Collection<Module> getModules() {
-            List<Module> modules = new ArrayList<>();
-            for (Module m : pool.getModules()) {
+        public Stream<? extends LinkModule> modules() {
+            List<LinkModule> modules = new ArrayList<>();
+            pool.modules().forEach(m -> {
                 modules.add(new LastModule(m));
-            }
-            return modules;
+            });
+            return modules.stream();
+        }
+
+        @Override
+        public int getModuleCount() {
+            return pool.getModuleCount();
         }
 
         /**
          * Get all resources contained in this pool instance.
          *
-         * @return The collection of resources;
+         * @return The stream of resources;
          */
         @Override
-        public Collection<ModuleData> getContent() {
+        public Stream<? extends ModuleEntry> entries() {
             if (content == null) {
                 content = new ArrayList<>();
-                for (ModuleData md : pool.getContent()) {
+                pool.entries().forEach(md -> {
                     content.add(getUncompressed(md));
-                }
+                });
             }
-            return content;
+            return content.stream();
+        }
+
+        @Override
+        public int getEntryCount() {
+            return pool.getEntryCount();
         }
 
         /**
          * Get the resource for the passed path.
          *
          * @param path A resource path
-         * @return A Resource instance or null if the resource is not found
+         * @return A Resource instance if the resource is found
          */
         @Override
-        public ModuleData get(String path) {
+        public Optional<ModuleEntry> findEntry(String path) {
             Objects.requireNonNull(path);
-            Pool.ModuleData res = pool.get(path);
-            return getUncompressed(res);
+            Optional<ModuleEntry> res = pool.findEntry(path);
+            return res.isPresent()? Optional.of(getUncompressed(res.get())) : Optional.empty();
         }
 
         @Override
-        public boolean contains(ModuleData res) {
+        public boolean contains(ModuleEntry res) {
             return pool.contains(res);
         }
 
@@ -426,8 +422,8 @@
         }
 
         @Override
-        public void visit(Visitor visitor, Pool output) {
-            pool.visit(visitor, output);
+        public void transformAndCopy(Function<ModuleEntry, ModuleEntry> visitor, ModulePool output) {
+            pool.transformAndCopy(visitor, output);
         }
 
         @Override
@@ -435,14 +431,19 @@
             return pool.getByteOrder();
         }
 
-        private ModuleData getUncompressed(ModuleData res) {
+        @Override
+        public Map<String, String> getReleaseProperties() {
+            return Collections.unmodifiableMap(pool.getReleaseProperties());
+        }
+
+        private ModuleEntry getUncompressed(ModuleEntry res) {
             if (res != null) {
-                if (res instanceof PoolImpl.CompressedModuleData) {
+                if (res instanceof ModulePoolImpl.CompressedModuleData) {
                     try {
                         byte[] bytes = decompressor.decompressResource(getByteOrder(),
                                 (int offset) -> pool.getStringTable().getString(offset),
                                 res.getBytes());
-                        res = Pool.newResource(res.getPath(),
+                        res = ModuleEntry.create(res.getPath(),
                                 new ByteArrayInputStream(bytes),
                                 bytes.length);
                     } catch (IOException ex) {
@@ -462,20 +463,24 @@
      * @param writer
      * @throws java.lang.Exception
      */
-    public void storeFiles(PoolImpl original, PoolImpl transformed,
+    public void storeFiles(ModulePoolImpl original, ModulePoolImpl transformed,
             BasicImageWriter writer)
             throws Exception {
         Objects.requireNonNull(original);
-        try {
-            // fill release information available from transformed "java.base" module!
-            ModuleDescriptor desc = transformed.getModule("java.base").getDescriptor();
-            desc.osName().ifPresent(s -> release.put("OS_NAME", s));
-            desc.osVersion().ifPresent(s -> release.put("OS_VERSION", s));
-            desc.osArch().ifPresent(s -> release.put("OS_ARCH", s));
-        } catch (Exception ignored) {
-        }
+        Objects.requireNonNull(transformed);
+        Optional<LinkModule> javaBase = transformed.findModule("java.base");
+        javaBase.ifPresent(mod -> {
+            try {
+                Map<String, String> release = transformed.getReleaseProperties();
+                // fill release information available from transformed "java.base" module!
+                ModuleDescriptor desc = mod.getDescriptor();
+                desc.osName().ifPresent(s -> release.put("OS_NAME", s));
+                desc.osVersion().ifPresent(s -> release.put("OS_VERSION", s));
+                desc.osArch().ifPresent(s -> release.put("OS_ARCH", s));
+            } catch (Exception ignored) {}
+        });
 
-        imageBuilder.storeFiles(new LastPool(transformed), release);
+        imageBuilder.storeFiles(new LastPool(transformed));
     }
 
     public ExecutableImage getExecutableImage() throws IOException {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModuleEntryImpl.java	Tue May 17 05:38:15 2016 -0700
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.tools.jlink.internal;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UncheckedIOException;
+import java.util.Objects;
+import jdk.tools.jlink.plugin.ModuleEntry;
+
+/**
+ * A LinkModuleEntry is the elementary unit of data inside an image. It is
+ * generally a file. e.g.: a java class file, a resource file, a shared library,
+ * ...
+ * <br>
+ * A LinkModuleEntry is identified by a path of the form:
+ * <ul>
+ * <li>For jimage content: /{module name}/{package1}/.../{packageN}/{file
+ * name}</li>
+ * <li>For other files (shared lib, launchers, config, ...):/{module name}/
+ * {@literal bin|conf|native}/{dir1}>/.../{dirN}/{file name}</li>
+ * </ul>
+ */
+public class ModuleEntryImpl implements ModuleEntry {
+
+    private final Type type;
+    private final String path;
+    private final String module;
+    private final long length;
+    private final InputStream stream;
+    private byte[] buffer;
+
+    /**
+     * Create a new LinkModuleEntry.
+     *
+     * @param module The module name.
+     * @param path The data path identifier.
+     * @param type The data type.
+     * @param stream The data content stream.
+     * @param length The stream length.
+     */
+    public ModuleEntryImpl(String module, String path, Type type, InputStream stream, long length) {
+        Objects.requireNonNull(module);
+        Objects.requireNonNull(path);
+        Objects.requireNonNull(type);
+        Objects.requireNonNull(stream);
+        this.path = path;
+        this.type = type;
+        this.module = module;
+        this.stream = stream;
+        this.length = length;
+    }
+
+    /**
+     * The LinkModuleEntry module name.
+     *
+     * @return The module name.
+     */
+    @Override
+    public final String getModule() {
+        return module;
+    }
+
+    /**
+     * The LinkModuleEntry path.
+     *
+     * @return The module path.
+     */
+    @Override
+    public final String getPath() {
+        return path;
+    }
+
+    /**
+     * The LinkModuleEntry's type.
+     *
+     * @return The data type.
+     */
+    @Override
+    public final Type getType() {
+        return type;
+    }
+
+    /**
+     * The LinkModuleEntry content as an array of byte.
+     *
+     * @return An Array of bytes.
+     */
+    @Override
+    public byte[] getBytes() {
+        if (buffer == null) {
+            try (InputStream is = stream) {
+                buffer = is.readAllBytes();
+            } catch (IOException ex) {
+                throw new UncheckedIOException(ex);
+            }
+        }
+        return buffer;
+    }
+
+    /**
+     * The LinkModuleEntry content length.
+     *
+     * @return The length.
+     */
+    @Override
+    public long getLength() {
+        return length;
+    }
+
+    /**
+     * The LinkModuleEntry stream.
+     *
+     * @return The module data stream.
+     */
+    @Override
+    public InputStream stream() {
+        return stream;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 7;
+        hash = 89 * hash + Objects.hashCode(this.path);
+        return hash;
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        if (!(other instanceof ModuleEntryImpl)) {
+            return false;
+        }
+        ModuleEntryImpl f = (ModuleEntryImpl) other;
+        return f.path.equals(path);
+    }
+
+    @Override
+    public String toString() {
+        return getPath();
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModulePoolImpl.java	Tue May 17 05:38:15 2016 -0700
@@ -0,0 +1,421 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.tools.jlink.internal;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.lang.module.ModuleDescriptor;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Stream;
+import jdk.internal.jimage.decompressor.CompressedResourceHeader;
+import jdk.tools.jlink.plugin.ModulePool;
+import jdk.tools.jlink.plugin.LinkModule;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.PluginException;
+import jdk.tools.jlink.internal.plugins.FileCopierPlugin;
+
+/**
+ * Pool of module data.
+ */
+public class ModulePoolImpl implements ModulePool {
+
+    private class ModuleImpl implements LinkModule {
+
+        final Map<String, ModuleEntry> moduleContent = new LinkedHashMap<>();
+        private ModuleDescriptor descriptor;
+        final String name;
+
+        private ModuleImpl(String name) {
+            this.name = name;
+        }
+
+        @Override
+        public String getName() {
+            return name;
+        }
+
+        @Override
+        public Optional<ModuleEntry> findEntry(String path) {
+            if (!path.startsWith("/")) {
+                path = "/" + path;
+            }
+            if (!path.startsWith("/" + name)) {
+                path = "/" + name + path;
+            }
+            return Optional.ofNullable(moduleContent.get(path));
+        }
+
+        @Override
+        public ModuleDescriptor getDescriptor() {
+            if (descriptor == null) {
+                String p = "/" + name + "/module-info.class";
+                Optional<ModuleEntry> content = findEntry(p);
+                if (!content.isPresent()) {
+                    throw new PluginException("No module-info for " + name
+                            + " module");
+                }
+                ByteBuffer bb = ByteBuffer.wrap(content.get().getBytes());
+                descriptor = ModuleDescriptor.read(bb);
+            }
+            return descriptor;
+        }
+
+        @Override
+        public void add(ModuleEntry data) {
+            if (isReadOnly()) {
+                throw new PluginException("LinkConfiguration is readonly");
+            }
+            Objects.requireNonNull(data);
+            if (!data.getModule().equals(name)) {
+                throw new PluginException("Can't add resource " + data.getPath()
+                        + " to module " + name);
+            }
+            ModulePoolImpl.this.add(data);
+        }
+
+        @Override
+        public Set<String> getAllPackages() {
+            Set<String> pkgs = new HashSet<>();
+            moduleContent.values().stream().filter(m -> m.getType().
+                    equals(ModuleEntry.Type.CLASS_OR_RESOURCE)).forEach(res -> {
+                // Module metadata only contains packages with .class files
+                if (ImageFileCreator.isClassPackage(res.getPath())) {
+                    String[] split = ImageFileCreator.splitPath(res.getPath());
+                    String pkg = split[1];
+                    if (pkg != null && !pkg.isEmpty()) {
+                        pkgs.add(pkg);
+                    }
+                }
+            });
+            return pkgs;
+        }
+
+        @Override
+        public String toString() {
+            return getName();
+        }
+
+        @Override
+        public Stream<? extends ModuleEntry> entries() {
+            return moduleContent.values().stream();
+        }
+
+        @Override
+        public int getEntryCount() {
+            return moduleContent.values().size();
+        }
+    }
+
+    private final Map<String, ModuleEntry> resources = new LinkedHashMap<>();
+    private final Map<String, ModuleImpl> modules = new LinkedHashMap<>();
+    private final ModuleImpl fileCopierModule = new ModuleImpl(FileCopierPlugin.FAKE_MODULE);
+    private Map<String, String> releaseProps = new HashMap<>();
+
+    private final ByteOrder order;
+
+    private boolean isReadOnly;
+    private final StringTable table;
+
+    public ModulePoolImpl() {
+        this(ByteOrder.nativeOrder());
+    }
+
+    public ModulePoolImpl(ByteOrder order) {
+        this(order, new StringTable() {
+
+            @Override
+            public int addString(String str) {
+                return -1;
+            }
+
+            @Override
+            public String getString(int id) {
+                return null;
+            }
+        });
+    }
+
+    public ModulePoolImpl(ByteOrder order, StringTable table) {
+        this.order = order;
+        this.table = table;
+    }
+
+    /**
+     * Add a ModuleEntry.
+     *
+     * @param data The ModuleEntry to add.
+     */
+    @Override
+    public void add(ModuleEntry data) {
+        if (isReadOnly()) {
+            throw new PluginException("LinkConfiguration is readonly");
+        }
+        Objects.requireNonNull(data);
+        if (resources.get(data.getPath()) != null) {
+            throw new PluginException("Resource " + data.getPath()
+                    + " already present");
+        }
+        String modulename = data.getModule();
+        ModuleImpl m = modules.get(modulename);
+        // ## TODO: FileCopierPlugin should not add content to a module
+        // FAKE_MODULE is not really a module to be added in the image
+        if (FileCopierPlugin.FAKE_MODULE.equals(modulename)) {
+            m = fileCopierModule;
+        }
+        if (m == null) {
+            m = new ModuleImpl(modulename);
+            modules.put(modulename, m);
+        }
+        resources.put(data.getPath(), data);
+        m.moduleContent.put(data.getPath(), data);
+    }
+
+    /**
+     * Retrieves the module for the provided name.
+     *
+     * @param name The module name
+     * @return the module of matching name, if found
+     */
+    @Override
+    public Optional<LinkModule> findModule(String name) {
+        Objects.requireNonNull(name);
+        return Optional.ofNullable(modules.get(name));
+    }
+
+    /**
+     * The stream of modules contained in this LinkConfiguration.
+     *
+     * @return The stream of modules.
+     */
+    @Override
+    public Stream<? extends LinkModule> modules() {
+        return modules.values().stream();
+    }
+
+    /**
+     * Return the number of LinkModule count in this LinkConfiguration.
+     *
+     * @return the module count.
+     */
+    @Override
+    public int getModuleCount() {
+        return modules.size();
+    }
+
+    /**
+     * Get all ModuleEntry contained in this LinkConfiguration instance.
+     *
+     * @return The stream of LinkModuleEntries.
+     */
+    @Override
+    public Stream<? extends ModuleEntry> entries() {
+        return resources.values().stream();
+    }
+
+    /**
+     * Return the number of ModuleEntry count in this LinkConfiguration.
+     *
+     * @return the entry count.
+     */
+    @Override
+    public int getEntryCount() {
+        return resources.values().size();
+    }
+
+    /**
+     * Get the ModuleEntry for the passed path.
+     *
+     * @param path A data path
+     * @return A ModuleEntry instance or null if the data is not found
+     */
+    @Override
+    public Optional<ModuleEntry> findEntry(String path) {
+        Objects.requireNonNull(path);
+        return Optional.ofNullable(resources.get(path));
+    }
+
+    /**
+     * Check if the LinkConfiguration contains the given ModuleEntry.
+     *
+     * @param data The module data to check existence for.
+     * @return The module data or null if not found.
+     */
+    @Override
+    public boolean contains(ModuleEntry data) {
+        Objects.requireNonNull(data);
+        return findEntry(data.getPath()).isPresent();
+    }
+
+    /**
+     * Check if the LinkConfiguration contains some content at all.
+     *
+     * @return True, no content, false otherwise.
+     */
+    @Override
+    public boolean isEmpty() {
+        return resources.isEmpty();
+    }
+
+    /**
+     * Visit each ModuleEntry in this LinkConfiguration to transform it and
+     * copy the transformed ModuleEntry to the output LinkConfiguration.
+     *
+     * @param transform The function called for each ModuleEntry found in
+     * the LinkConfiguration. The transform function should return a
+     * ModuleEntry instance which will be added to the output or it should
+     * return null if the passed ModuleEntry is to be ignored for the
+     * output.
+     *
+     * @param output The LinkConfiguration to be filled with Visitor returned
+     * ModuleEntry.
+     */
+    @Override
+    public void transformAndCopy(Function<ModuleEntry, ModuleEntry> transform,
+            ModulePool output) {
+        entries().forEach(resource -> {
+            ModuleEntry res = transform.apply(resource);
+            if (res != null) {
+                output.add(res);
+            }
+        });
+    }
+
+    /**
+     * The ByteOrder currently in use when generating the jimage file.
+     *
+     * @return The ByteOrder.
+     */
+    @Override
+    public ByteOrder getByteOrder() {
+        return order;
+    }
+
+    @Override
+    public Map<String, String> getReleaseProperties() {
+        return isReadOnly()? Collections.unmodifiableMap(releaseProps) : releaseProps;
+    }
+
+    public StringTable getStringTable() {
+        return table;
+    }
+
+    /**
+     * Make this Resources instance read-only. No resource can be added.
+     */
+    public void setReadOnly() {
+        isReadOnly = true;
+    }
+
+    /**
+     * Read only state.
+     *
+     * @return true if readonly false otherwise.
+     */
+    @Override
+    public boolean isReadOnly() {
+        return isReadOnly;
+    }
+
+    /**
+     * A resource that has been compressed.
+     */
+    public static final class CompressedModuleData extends ModuleEntryImpl {
+
+        final long uncompressed_size;
+
+        private CompressedModuleData(String module, String path,
+                InputStream stream, long size,
+                long uncompressed_size) {
+            super(module, path, ModuleEntry.Type.CLASS_OR_RESOURCE, stream, size);
+            this.uncompressed_size = uncompressed_size;
+        }
+
+        public long getUncompressedSize() {
+            return uncompressed_size;
+        }
+
+        @Override
+        public boolean equals(Object other) {
+            if (!(other instanceof CompressedModuleData)) {
+                return false;
+            }
+            CompressedModuleData f = (CompressedModuleData) other;
+            return f.getPath().equals(getPath());
+        }
+
+        @Override
+        public int hashCode() {
+            return super.hashCode();
+        }
+    }
+
+    public static CompressedModuleData newCompressedResource(ModuleEntry original,
+            ByteBuffer compressed,
+            String plugin, String pluginConfig, StringTable strings,
+            ByteOrder order) {
+        Objects.requireNonNull(original);
+        Objects.requireNonNull(compressed);
+        Objects.requireNonNull(plugin);
+
+        boolean isTerminal = !(original instanceof CompressedModuleData);
+        long uncompressed_size = original.getLength();
+        if (original instanceof CompressedModuleData) {
+            CompressedModuleData comp = (CompressedModuleData) original;
+            uncompressed_size = comp.getUncompressedSize();
+        }
+        int nameOffset = strings.addString(plugin);
+        int configOffset = -1;
+        if (pluginConfig != null) {
+            configOffset = strings.addString(plugin);
+        }
+        CompressedResourceHeader rh
+                = new CompressedResourceHeader(compressed.limit(), original.getLength(),
+                        nameOffset, configOffset, isTerminal);
+        // Merge header with content;
+        byte[] h = rh.getBytes(order);
+        ByteBuffer bb = ByteBuffer.allocate(compressed.limit() + h.length);
+        bb.order(order);
+        bb.put(h);
+        bb.put(compressed);
+        byte[] contentWithHeader = bb.array();
+
+        CompressedModuleData compressedResource
+                = new CompressedModuleData(original.getModule(), original.getPath(),
+                        new ByteArrayInputStream(contentWithHeader),
+                        contentWithHeader.length, uncompressed_size);
+        return compressedResource;
+    }
+
+}
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginContextImpl.java	Sat May 14 09:11:07 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal;
-
-import java.util.Properties;
-
-import jdk.tools.jlink.plugin.PluginContext;
-
-public final class PluginContextImpl implements PluginContext {
-    private final Properties releaseProps = new Properties();
-
-    public Properties getReleaseProperties() {
-        return releaseProps;
-    }
-}
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PoolImpl.java	Sat May 14 09:11:07 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.Objects;
-import jdk.internal.jimage.decompressor.CompressedResourceHeader;
-import jdk.tools.jlink.plugin.Pool;
-
-/**
- * Pool of module data.
- */
-public class PoolImpl extends Pool {
-
-    /**
-     * A resource that has been compressed.
-     */
-    public static final class CompressedModuleData extends ModuleData {
-
-        private final long uncompressed_size;
-
-        private CompressedModuleData(String module, String path,
-                InputStream stream, long size,
-                long uncompressed_size) {
-            super(module, path, ModuleDataType.CLASS_OR_RESOURCE, stream, size);
-            this.uncompressed_size = uncompressed_size;
-        }
-
-        public long getUncompressedSize() {
-            return uncompressed_size;
-        }
-
-        @Override
-        public boolean equals(Object other) {
-            if (!(other instanceof CompressedModuleData)) {
-                return false;
-            }
-            CompressedModuleData f = (CompressedModuleData) other;
-            return f.getPath().equals(getPath());
-        }
-
-        @Override
-        public int hashCode() {
-            return super.hashCode();
-        }
-    }
-
-    private boolean isReadOnly;
-    private final StringTable table;
-
-    public PoolImpl() {
-        this(ByteOrder.nativeOrder(), new StringTable() {
-
-            @Override
-            public int addString(String str) {
-                return -1;
-            }
-            @Override
-            public String getString(int id) {
-                return null;
-            }
-        });
-    }
-
-    public PoolImpl(ByteOrder order) {
-        this(order, new StringTable() {
-
-            @Override
-            public int addString(String str) {
-                return -1;
-            }
-            @Override
-            public String getString(int id) {
-                return null;
-            }
-        });
-    }
-
-    public PoolImpl(ByteOrder order, StringTable table) {
-        super(order);
-        this.table = table;
-    }
-
-    public StringTable getStringTable() {
-        return table;
-    }
-
-    /**
-     * Make this Resources instance read-only. No resource can be added.
-     */
-    public void setReadOnly() {
-        isReadOnly = true;
-    }
-
-    /**
-     * Read only state.
-     *
-     * @return true if readonly false otherwise.
-     */
-    @Override
-    public boolean isReadOnly() {
-        return isReadOnly;
-    }
-
-    public static CompressedModuleData newCompressedResource(ModuleData original,
-            ByteBuffer compressed,
-            String plugin, String pluginConfig, StringTable strings,
-            ByteOrder order) {
-        Objects.requireNonNull(original);
-        Objects.requireNonNull(compressed);
-        Objects.requireNonNull(plugin);
-
-        boolean isTerminal = !(original instanceof CompressedModuleData);
-        long uncompressed_size = original.getLength();
-        if (original instanceof CompressedModuleData) {
-            CompressedModuleData comp = (CompressedModuleData) original;
-            uncompressed_size = comp.getUncompressedSize();
-        }
-        int nameOffset = strings.addString(plugin);
-        int configOffset = -1;
-        if (pluginConfig != null) {
-            configOffset = strings.addString(plugin);
-        }
-        CompressedResourceHeader rh
-                = new CompressedResourceHeader(compressed.limit(), original.getLength(),
-                        nameOffset, configOffset, isTerminal);
-        // Merge header with content;
-        byte[] h = rh.getBytes(order);
-        ByteBuffer bb = ByteBuffer.allocate(compressed.limit() + h.length);
-        bb.order(order);
-        bb.put(h);
-        bb.put(compressed);
-        byte[] contentWithHeader = bb.array();
-
-        CompressedModuleData compressedResource
-                = new CompressedModuleData(original.getModule(), original.getPath(),
-                        new ByteArrayInputStream(contentWithHeader),
-                        contentWithHeader.length, uncompressed_size);
-        return compressedResource;
-    }
-
-}
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePrevisitor.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePrevisitor.java	Tue May 17 05:38:15 2016 -0700
@@ -24,7 +24,7 @@
  */
 package jdk.tools.jlink.internal;
 
-import jdk.tools.jlink.plugin.Pool;
+import jdk.tools.jlink.plugin.ModulePool;
 
 /**
  * Plugin wishing to pre-visit the resources must implement this interface.
@@ -44,5 +44,5 @@
      * usage.
      * @throws PluginException
      */
-    public void previsit(Pool resources, StringTable strings);
+    public void previsit(ModulePool resources, StringTable strings);
 }
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Tue May 17 05:38:15 2016 -0700
@@ -52,7 +52,7 @@
 import jdk.tools.jlink.Jlink;
 import jdk.tools.jlink.Jlink.PluginsConfiguration;
 import jdk.tools.jlink.plugin.Plugin;
-import jdk.tools.jlink.plugin.Plugin.CATEGORY;
+import jdk.tools.jlink.plugin.Plugin.Category;
 import jdk.tools.jlink.builder.DefaultImageBuilder;
 import jdk.tools.jlink.builder.ImageBuilder;
 import jdk.tools.jlink.plugin.PluginException;
@@ -346,7 +346,6 @@
                 }
             }
 
-            PluginContextImpl pluginContext = new PluginContextImpl();
             List<Plugin> pluginsList = new ArrayList<>();
             for (Entry<Plugin, List<Map<String, String>>> entry : pluginToMaps.entrySet()) {
                 Plugin plugin = entry.getKey();
@@ -356,7 +355,7 @@
                 // we call configure once for each occurrence. It is upto the plugin
                 // to 'merge' and/or 'override' arguments.
                 for (Map<String, String> map : argsMaps) {
-                    plugin.configure(Collections.unmodifiableMap(map), pluginContext);
+                    plugin.configure(Collections.unmodifiableMap(map));
                 }
 
                 if (!Utils.isDisabled(plugin)) {
@@ -371,7 +370,7 @@
 
             }
             return new Jlink.PluginsConfiguration(pluginsList,
-                    builder, lastSorter, pluginContext);
+                    builder, lastSorter);
         }
     }
 
@@ -594,7 +593,7 @@
                          + ": " + plugin.getClass().getName());
                     log.println(bundleHelper.getMessage("main.plugin.module")
                          + ": " + plugin.getClass().getModule().getName());
-                    CATEGORY category = Utils.getCategory(plugin);
+                    Category category = Utils.getCategory(plugin);
                     log.println(bundleHelper.getMessage("main.plugin.category")
                          + ": " + category.getName());
                     log.println(bundleHelper.getMessage("main.plugin.state")
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java	Tue May 17 05:38:15 2016 -0700
@@ -30,7 +30,6 @@
 import java.util.List;
 import java.util.function.Function;
 import jdk.tools.jlink.plugin.Plugin;
-import jdk.tools.jlink.plugin.Plugin.PluginType;
 
 public class Utils {
 
@@ -50,25 +49,26 @@
         return arguments;
     };
 
-    public static boolean isPostProcessor(Plugin.CATEGORY category) {
-        return category.equals(Plugin.CATEGORY.VERIFIER)
-                || category.equals(Plugin.CATEGORY.PROCESSOR)
-                || category.equals(Plugin.CATEGORY.PACKAGER);
+    public static boolean isPostProcessor(Plugin.Category category) {
+        return category.equals(Plugin.Category.VERIFIER)
+                || category.equals(Plugin.Category.PROCESSOR)
+                || category.equals(Plugin.Category.PACKAGER);
     }
 
-    public static boolean isPreProcessor(Plugin.CATEGORY category) {
-        return category.equals(Plugin.CATEGORY.COMPRESSOR)
-                || category.equals(Plugin.CATEGORY.FILTER)
-                || category.equals(Plugin.CATEGORY.MODULEINFO_TRANSFORMER)
-                || category.equals(Plugin.CATEGORY.SORTER)
-                || category.equals(Plugin.CATEGORY.TRANSFORMER);
+    public static boolean isPreProcessor(Plugin.Category category) {
+        return category.equals(Plugin.Category.COMPRESSOR)
+                || category.equals(Plugin.Category.FILTER)
+                || category.equals(Plugin.Category.MODULEINFO_TRANSFORMER)
+                || category.equals(Plugin.Category.SORTER)
+                || category.equals(Plugin.Category.TRANSFORMER)
+                || category.equals(Plugin.Category.METAINFO_ADDER);
     }
 
     public static boolean isPostProcessor(Plugin prov) {
         if (prov.getType() != null) {
-            for (PluginType pt : prov.getType()) {
-                if (pt instanceof Plugin.CATEGORY) {
-                    return isPostProcessor((Plugin.CATEGORY) pt);
+            for (Plugin.Category pt : prov.getType()) {
+                if (pt instanceof Plugin.Category) {
+                    return isPostProcessor(pt);
                 }
             }
         }
@@ -77,20 +77,20 @@
 
     public static boolean isPreProcessor(Plugin prov) {
         if (prov.getType() != null) {
-            for (PluginType pt : prov.getType()) {
-                if (pt instanceof Plugin.CATEGORY) {
-                    return isPreProcessor((Plugin.CATEGORY) pt);
+            for (Plugin.Category pt : prov.getType()) {
+                if (pt instanceof Plugin.Category) {
+                    return isPreProcessor(pt);
                 }
             }
         }
         return false;
     }
 
-    public static Plugin.CATEGORY getCategory(Plugin provider) {
+    public static Plugin.Category getCategory(Plugin provider) {
         if (provider.getType() != null) {
-            for (Plugin.PluginType t : provider.getType()) {
-                if (t instanceof Plugin.CATEGORY) {
-                    return (Plugin.CATEGORY) t;
+            for (Plugin.Category t : provider.getType()) {
+                if (t instanceof Plugin.Category) {
+                    return t;
                 }
             }
         }
@@ -140,15 +140,15 @@
     }
 
     public static boolean isFunctional(Plugin prov) {
-        return prov.getState().contains(Plugin.STATE.FUNCTIONAL);
+        return prov.getState().contains(Plugin.State.FUNCTIONAL);
     }
 
     public static boolean isAutoEnabled(Plugin prov) {
-        return prov.getState().contains(Plugin.STATE.AUTO_ENABLED);
+        return prov.getState().contains(Plugin.State.AUTO_ENABLED);
     }
 
     public static boolean isDisabled(Plugin prov) {
-        return prov.getState().contains(Plugin.STATE.DISABLED);
+        return prov.getState().contains(Plugin.State.DISABLED);
     }
 
     // is this a builtin (jdk.jlink) plugin?
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java	Tue May 17 05:38:15 2016 -0700
@@ -30,7 +30,7 @@
 import jdk.tools.jlink.builder.ImageBuilder;
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.builder.*;
-import jdk.tools.jlink.plugin.Pool;
+import jdk.tools.jlink.plugin.ModulePool;
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -26,16 +26,13 @@
 
 import java.io.IOException;
 import java.io.UncheckedIOException;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.internal.PoolImpl;
-import jdk.tools.jlink.plugin.Pool;
+import jdk.tools.jlink.internal.ModulePoolImpl;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 import jdk.tools.jlink.internal.ImagePluginStack;
 import jdk.tools.jlink.internal.ResourcePrevisitor;
@@ -62,10 +59,10 @@
     }
 
     @Override
-    public void visit(Pool in, Pool out) {
+    public void visit(ModulePool in, ModulePool out) {
         if (ss != null && zip != null) {
-            Pool output = new ImagePluginStack.OrderedResourcePool(in.getByteOrder(),
-                    ((PoolImpl) in).getStringTable());
+            ModulePool output = new ImagePluginStack.OrderedResourcePool(in.getByteOrder(),
+                    ((ModulePoolImpl) in).getStringTable());
             ss.visit(in, output);
             zip.visit(output, out);
         } else if (ss != null) {
@@ -76,16 +73,16 @@
     }
 
     @Override
-    public void previsit(Pool resources, StringTable strings) {
+    public void previsit(ModulePool resources, StringTable strings) {
         if (ss != null) {
             ss.previsit(resources, strings);
         }
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.COMPRESSOR);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.COMPRESSOR);
         return Collections.unmodifiableSet(set);
     }
 
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeFilesPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeFilesPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -32,8 +32,8 @@
 import java.util.Set;
 import java.util.function.Predicate;
 import jdk.tools.jlink.plugin.TransformerPlugin;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleDataType;
+import jdk.tools.jlink.plugin.ModulePool;
+import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.internal.Utils;
 
 /**
@@ -51,9 +51,9 @@
     }
 
     @Override
-    public void visit(Pool in, Pool out) {
-        in.visit((file) -> {
-            if (!file.getType().equals(ModuleDataType.CLASS_OR_RESOURCE)) {
+    public void visit(ModulePool in, ModulePool out) {
+        in.transformAndCopy((file) -> {
+            if (!file.getType().equals(ModuleEntry.Type.CLASS_OR_RESOURCE)) {
                 file = predicate.test(file.getPath()) ? file : null;
             }
             return file;
@@ -61,9 +61,9 @@
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.FILTER);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.FILTER);
         return Collections.unmodifiableSet(set);
     }
 
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludePlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludePlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -32,7 +32,8 @@
 import java.util.function.Predicate;
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.TransformerPlugin;
-import jdk.tools.jlink.plugin.Pool;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.internal.Utils;
 
 /**
@@ -50,9 +51,9 @@
     }
 
     @Override
-    public void visit(Pool in, Pool out) {
-        in.visit((resource) -> {
-            if (resource.getType().equals(Pool.ModuleDataType.CLASS_OR_RESOURCE)) {
+    public void visit(ModulePool in, ModulePool out) {
+        in.transformAndCopy((resource) -> {
+            if (resource.getType().equals(ModuleEntry.Type.CLASS_OR_RESOURCE)) {
                 resource = predicate.test(resource.getPath()) ? resource : null;
             }
             return resource;
@@ -75,9 +76,9 @@
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.FILTER);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.FILTER);
         return Collections.unmodifiableSet(set);
     }
 
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -40,9 +40,10 @@
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
 import jdk.tools.jlink.plugin.TransformerPlugin;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleDataType;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.internal.Utils;
+import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.PluginException;
 
 /**
@@ -102,24 +103,24 @@
      * e.g.: /java.base/native/amd64/server/libjvm.so
      * /java.base/native/server/libjvm.dylib
      */
-    private List<Pool.ModuleData> getVMs(Pool in) {
+    private List<ModuleEntry> getVMs(ModulePool in) {
         String jvmlib = jvmlib();
-        List<Pool.ModuleData> ret = in.getModule("java.base").getContent().stream().filter((t) -> {
+        List<ModuleEntry> ret = in.findModule("java.base").get().entries().filter((t) -> {
             return t.getPath().endsWith("/" + jvmlib);
         }).collect(Collectors.toList());
         return ret;
     }
 
     @Override
-    public void visit(Pool in, Pool out) {
+    public void visit(ModulePool in, ModulePool out) {
         String jvmlib = jvmlib();
         TreeSet<Jvm> existing = new TreeSet<>(new JvmComparator());
         TreeSet<Jvm> removed = new TreeSet<>(new JvmComparator());
         if (!keepAll) {
             // First retrieve all available VM names and removed VM
-            List<Pool.ModuleData> jvms = getVMs(in);
+            List<ModuleEntry> jvms = getVMs(in);
             for (Jvm jvm : Jvm.values()) {
-                for (Pool.ModuleData md : jvms) {
+                for (ModuleEntry md : jvms) {
                     if (md.getPath().endsWith("/" + jvm.getName() + "/" + jvmlib)) {
                         existing.add(jvm);
                         if (isRemoved(md)) {
@@ -137,9 +138,9 @@
         }
 
         // Rewrite the jvm.cfg file.
-        in.visit((file) -> {
+        in.transformAndCopy((file) -> {
             if (!keepAll) {
-                if (file.getType().equals(ModuleDataType.NATIVE_LIB)) {
+                if (file.getType().equals(ModuleEntry.Type.NATIVE_LIB)) {
                     if (file.getPath().endsWith(JVM_CFG)) {
                         try {
                             file = handleJvmCfgFile(file, existing, removed);
@@ -155,14 +156,14 @@
 
     }
 
-    private boolean isRemoved(Pool.ModuleData file) {
+    private boolean isRemoved(ModuleEntry file) {
         return !predicate.test(file.getPath());
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.FILTER);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.FILTER);
         return Collections.unmodifiableSet(set);
     }
 
@@ -217,7 +218,7 @@
         }
     }
 
-    private Pool.ModuleData handleJvmCfgFile(Pool.ModuleData orig,
+    private ModuleEntry handleJvmCfgFile(ModuleEntry orig,
             TreeSet<Jvm> existing,
             TreeSet<Jvm> removed) throws IOException {
         if (keepAll) {
@@ -253,7 +254,7 @@
 
         byte[] content = builder.toString().getBytes(StandardCharsets.UTF_8);
 
-        return Pool.newImageFile(orig.getModule(),
+        return ModuleEntry.create(orig.getModule(),
                 orig.getPath(),
                 orig.getType(),
                 new ByteArrayInputStream(content), content.length);
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/FileCopierPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/FileCopierPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -41,10 +41,10 @@
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
+import jdk.tools.jlink.internal.ModuleEntryImpl;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleData;
-import jdk.tools.jlink.plugin.Pool.ModuleDataType;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 import jdk.tools.jlink.internal.Utils;
 
@@ -68,12 +68,12 @@
     /**
      * Symbolic link to another path.
      */
-    public static abstract class SymImageFile extends Pool.ModuleData {
+    public static abstract class SymImageFile extends ModuleEntryImpl {
 
         private final String targetPath;
 
         public SymImageFile(String targetPath, String module, String path,
-                Pool.ModuleDataType type, InputStream stream, long size) {
+                ModuleEntry.Type type, InputStream stream, long size) {
             super(module, path, type, stream, size);
             this.targetPath = targetPath;
         }
@@ -86,7 +86,7 @@
     private static final class SymImageFileImpl extends SymImageFile {
 
         public SymImageFileImpl(String targetPath, Path file, String module,
-                String path, ModuleDataType type) {
+                String path, ModuleEntry.Type type) {
             super(targetPath, module, path, type, newStream(file), length(file));
         }
     }
@@ -110,11 +110,11 @@
     private static final class DirectoryCopy implements FileVisitor<Path> {
 
         private final Path source;
-        private final Pool pool;
+        private final ModulePool pool;
         private final String targetDir;
         private final List<SymImageFile> symlinks = new ArrayList<>();
 
-        DirectoryCopy(Path source, Pool pool, String targetDir) {
+        DirectoryCopy(Path source, ModulePool pool, String targetDir) {
             this.source = source;
             this.pool = pool;
             this.targetDir = targetDir;
@@ -148,7 +148,7 @@
                 }
                 SymImageFileImpl impl = new SymImageFileImpl(symTarget.toString(),
                         file, path, Objects.requireNonNull(file.getFileName()).toString(),
-                        Pool.ModuleDataType.OTHER);
+                        ModuleEntry.Type.OTHER);
                 symlinks.add(impl);
             } else {
                 addFile(pool, file, path);
@@ -172,14 +172,14 @@
         }
     }
 
-    private static void addFile(Pool pool, Path file, String path)
+    private static void addFile(ModulePool pool, Path file, String path)
             throws IOException {
         Objects.requireNonNull(pool);
         Objects.requireNonNull(file);
         Objects.requireNonNull(path);
-        ModuleData impl = Pool.newImageFile(FAKE_MODULE,
+        ModuleEntry impl = ModuleEntry.create(FAKE_MODULE,
                 "/" + FAKE_MODULE + "/other/" + path,
-                Pool.ModuleDataType.OTHER, newStream(file), length(file));
+                ModuleEntry.Type.OTHER, newStream(file), length(file));
         try {
             pool.add(impl);
         } catch (Exception ex) {
@@ -188,9 +188,9 @@
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.TRANSFORMER);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.TRANSFORMER);
         return Collections.unmodifiableSet(set);
     }
 
@@ -239,8 +239,8 @@
     }
 
     @Override
-    public void visit(Pool in, Pool out) {
-        in.visit((file) -> {
+    public void visit(ModulePool in, ModulePool out) {
+        in.transformAndCopy((file) -> {
             return file;
         }, out);
 
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -33,8 +33,9 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
+import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 
 /**
@@ -60,8 +61,8 @@
     }
 
     @Override
-    public Set<PluginType> getType() {
-        return Collections.singleton(CATEGORY.TRANSFORMER);
+    public Set<Category> getType() {
+        return Collections.singleton(Category.TRANSFORMER);
     }
 
     @Override
@@ -75,8 +76,8 @@
     }
 
     @Override
-    public Set<STATE> getState() {
-        return EnumSet.of(STATE.AUTO_ENABLED, STATE.FUNCTIONAL);
+    public Set<State> getState() {
+        return EnumSet.of(State.AUTO_ENABLED, State.FUNCTIONAL);
     }
 
     @Override
@@ -151,8 +152,8 @@
     }
 
     @Override
-    public void visit(Pool in, Pool out) {
-        for (Pool.ModuleData data : in.getContent()) {
+    public void visit(ModulePool in, ModulePool out) {
+        in.entries().forEach(data -> {
             if (("/java.base/" + BMH + ".class").equals(data.getPath())) {
                 // Add BoundMethodHandle unchanged
                 out.add(data);
@@ -162,11 +163,11 @@
                     out.add(data);
                 }
             }
-        }
+        });
     }
 
     @SuppressWarnings("unchecked")
-    private void generateConcreteClass(String types, Pool.ModuleData data, Pool out) {
+    private void generateConcreteClass(String types, ModuleEntry data, ModulePool out) {
         try {
             // Generate class
             Map.Entry<String, byte[]> result = (Map.Entry<String, byte[]>)
@@ -175,9 +176,9 @@
             byte[] bytes = result.getValue();
 
             // Add class to pool
-            Pool.ModuleData ndata = new Pool.ModuleData(data.getModule(),
+            ModuleEntry ndata = ModuleEntry.create(data.getModule(),
                     "/java.base/" + className + ".class",
-                    Pool.ModuleDataType.CLASS_OR_RESOURCE,
+                    ModuleEntry.Type.CLASS_OR_RESOURCE,
                     new ByteArrayInputStream(bytes), bytes.length);
             if (!out.contains(ndata)) {
                 out.add(ndata);
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -34,6 +34,7 @@
 import java.util.Locale;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.Set;
 import java.util.function.Predicate;
 import java.util.regex.Pattern;
@@ -44,9 +45,10 @@
 import jdk.tools.jlink.internal.ResourcePrevisitor;
 import jdk.tools.jlink.internal.StringTable;
 import jdk.tools.jlink.internal.Utils;
+import jdk.tools.jlink.plugin.LinkModule;
+import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleDataType;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 
 /**
@@ -112,19 +114,19 @@
     }
 
     @Override
-    public void visit(Pool in, Pool out) {
-        in.visit((resource) -> {
+    public void visit(ModulePool in, ModulePool out) {
+        in.transformAndCopy((resource) -> {
             if (resource.getModule().equals(MODULENAME)) {
                 String path = resource.getPath();
                 resource = predicate.test(path) ? resource: null;
                 if (resource != null &&
-                    resource.getType().equals(ModuleDataType.CLASS_OR_RESOURCE)) {
+                    resource.getType().equals(ModuleEntry.Type.CLASS_OR_RESOURCE)) {
                     byte[] bytes = resource.getBytes();
                     ClassReader cr = new ClassReader(bytes);
                     if (Arrays.stream(cr.getInterfaces())
                         .anyMatch(i -> i.contains(METAINFONAME)) &&
                         stripUnsupportedLocales(bytes, cr)) {
-                        resource = new Pool.ModuleData(MODULENAME, path,
+                        resource = ModuleEntry.create(MODULENAME, path,
                             resource.getType(),
                             new ByteArrayInputStream(bytes), bytes.length);
                     }
@@ -135,9 +137,9 @@
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.FILTER);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.FILTER);
         return Collections.unmodifiableSet(set);
     }
 
@@ -172,12 +174,13 @@
     }
 
     @Override
-    public void previsit(Pool resources, StringTable strings) {
+    public void previsit(ModulePool resources, StringTable strings) {
         final Pattern p = Pattern.compile(".*((Data_)|(Names_))(?<tag>.*)\\.class");
-        Pool.Module module = resources.getModule(MODULENAME);
+        Optional<LinkModule> optMod = resources.findModule(MODULENAME);
 
         // jdk.localedata module validation
-        if (module != null) {
+        if (optMod.isPresent()) {
+            LinkModule module = optMod.get();
             Set<String> packages = module.getAllPackages();
             if (!packages.containsAll(LOCALEDATA_PACKAGES)) {
                 throw new PluginException(PluginsResourceBundle.getMessage(NAME + ".missingpackages") +
@@ -186,7 +189,7 @@
                         .collect(Collectors.joining(",\n\t")));
             }
 
-            available = Stream.concat(module.getContent().stream()
+            available = Stream.concat(module.entries()
                                         .map(md -> p.matcher(md.getPath()))
                                         .filter(m -> m.matches())
                                         .map(m -> m.group("tag").replaceAll("_", "-")),
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OptimizationPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OptimizationPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -24,7 +24,6 @@
  */
 package jdk.tools.jlink.internal.plugins;
 
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -287,9 +286,9 @@
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.TRANSFORMER);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.TRANSFORMER);
         return Collections.unmodifiableSet(set);
     }
 }
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OrderResourcesPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OrderResourcesPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -36,9 +36,8 @@
 import java.util.Set;
 import java.util.function.ToIntFunction;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleData;
-import jdk.tools.jlink.plugin.Pool.ModuleDataType;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 import jdk.tools.jlink.internal.Utils;
 
@@ -62,15 +61,15 @@
     }
 
     static class SortWrapper {
-        private final ModuleData resource;
+        private final ModuleEntry resource;
         private final int ordinal;
 
-        SortWrapper(ModuleData resource, int ordinal) {
+        SortWrapper(ModuleEntry resource, int ordinal) {
             this.resource = resource;
             this.ordinal = ordinal;
         }
 
-        ModuleData getResource() {
+        ModuleEntry getResource() {
             return resource;
         }
 
@@ -95,7 +94,7 @@
         return path;
     }
 
-    private int getOrdinal(ModuleData resource) {
+    private int getOrdinal(ModuleEntry resource) {
         String path = resource.getPath();
 
         Integer value = orderedPaths.get(stripModule(path));
@@ -126,23 +125,23 @@
     }
 
     @Override
-    public void visit(Pool in, Pool out) {
-        in.getContent().stream()
+    public void visit(ModulePool in, ModulePool out) {
+        in.entries()
                 .filter(resource -> resource.getType()
-                        .equals(ModuleDataType.CLASS_OR_RESOURCE))
+                        .equals(ModuleEntry.Type.CLASS_OR_RESOURCE))
                 .map((resource) -> new SortWrapper(resource, getOrdinal(resource)))
                 .sorted(OrderResourcesPlugin::compare)
                 .forEach((wrapper) -> out.add(wrapper.getResource()));
-        in.getContent().stream()
+        in.entries()
                 .filter(other -> !other.getType()
-                        .equals(ModuleDataType.CLASS_OR_RESOURCE))
+                        .equals(ModuleEntry.Type.CLASS_OR_RESOURCE))
                 .forEach((other) -> out.add(other));
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.SORTER);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.SORTER);
 
         return Collections.unmodifiableSet(set);
     }
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -24,34 +24,33 @@
  */
 package jdk.tools.jlink.internal.plugins;
 
-import java.lang.module.ModuleDescriptor;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.EnumSet;
-import java.util.List;
+import java.util.HashMap;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
-import java.util.Properties;
-
+import java.util.function.Function;
 import jdk.tools.jlink.internal.Utils;
-import jdk.tools.jlink.plugin.ExecutableImage;
-import jdk.tools.jlink.plugin.PluginContext;
-import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.PostProcessorPlugin;
+import jdk.tools.jlink.plugin.ModulePool;
+import jdk.tools.jlink.plugin.Plugin.Category;
+import jdk.tools.jlink.plugin.Plugin.State;
+import jdk.tools.jlink.plugin.TransformerPlugin;
 
 /**
  * This plugin adds/deletes information for 'release' file.
  */
-public final class ReleaseInfoPlugin implements PostProcessorPlugin {
+public final class ReleaseInfoPlugin implements TransformerPlugin {
     // option name
     public static final String NAME = "release-info";
     public static final String KEYS = "keys";
+    private final Map<String, String> release = new HashMap<>();
 
     @Override
-    public Set<PluginType> getType() {
-        return Collections.singleton(CATEGORY.PROCESSOR);
+    public Set<Category> getType() {
+        return Collections.singleton(Category.METAINFO_ADDER);
     }
 
     @Override
@@ -65,8 +64,8 @@
     }
 
     @Override
-    public Set<STATE> getState() {
-        return EnumSet.of(STATE.FUNCTIONAL);
+    public Set<State> getState() {
+        return EnumSet.of(State.FUNCTIONAL);
     }
 
     @Override
@@ -80,49 +79,49 @@
     }
 
     @Override
-    public void configure(Map<String, String> config, PluginContext ctx) {
-        Properties release = ctx != null? ctx.getReleaseProperties() : null;
-        if (release != null) {
-            String operation = config.get(NAME);
-            switch (operation) {
-                case "add": {
-                    // leave it to open-ended! source, java_version, java_full_version
-                    // can be passed via this option like:
-                    //
-                    //     --release-info add:build_type=fastdebug,source=openjdk,java_version=9
-                    // and put whatever value that was passed in command line.
+    public void configure(Map<String, String> config) {
+        String operation = config.get(NAME);
+        switch (operation) {
+            case "add": {
+                // leave it to open-ended! source, java_version, java_full_version
+                // can be passed via this option like:
+                //
+                //     --release-info add:build_type=fastdebug,source=openjdk,java_version=9
+                // and put whatever value that was passed in command line.
 
-                    config.keySet().stream().
-                        filter(s -> !NAME.equals(s)).
-                        forEach(s -> release.put(s, config.get(s)));
+                config.keySet().stream().
+                    filter(s -> !NAME.equals(s)).
+                    forEach(s -> release.put(s, config.get(s)));
+            }
+            break;
+
+            case "del": {
+                // --release-info del:keys=openjdk,java_version
+                String[] keys = Utils.listParser.apply(config.get(KEYS));
+                for (String k : keys) {
+                    release.remove(k);
                 }
-                break;
+            }
+            break;
 
-                case "del": {
-                    // --release-info del:keys=openjdk,java_version
-                    String[] keys = Utils.listParser.apply(config.get(KEYS));
-                    for (String k : keys) {
-                        release.remove(k);
-                    }
+            default: {
+                // --release-info <file>
+                Properties props = new Properties();
+                try (FileInputStream fis = new FileInputStream(operation)) {
+                    props.load(fis);
+                } catch (IOException exp) {
+                    throw new RuntimeException(exp);
                 }
-                break;
-
-                default: {
-                    // --release-info <file>
-                    try (FileInputStream fis = new FileInputStream(operation)) {
-                        release.load(fis);
-                    } catch (IOException exp) {
-                        throw new RuntimeException(exp);
-                    }
-                }
-                break;
+                props.forEach((k, v) -> release.put(k.toString(), v.toString()));
             }
+            break;
         }
     }
 
     @Override
-    public List<String> process(ExecutableImage image) {
-        // Nothing to do! Release info copied already during configure!
-        return Collections.emptyList();
+    public void visit(ModulePool in, ModulePool out) {
+        in.transformAndCopy(Function.identity(), out);
+        out.getReleaseProperties().putAll(in.getReleaseProperties());
+        out.getReleaseProperties().putAll(release);
     }
 }
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StringSharingPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StringSharingPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -56,11 +56,11 @@
 import jdk.internal.jimage.decompressor.CompressIndexes;
 import jdk.internal.jimage.decompressor.SignatureParser;
 import jdk.internal.jimage.decompressor.StringSharingDecompressor;
-import jdk.tools.jlink.internal.PoolImpl;
+import jdk.tools.jlink.internal.ModulePoolImpl;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleData;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.internal.ResourcePrevisitor;
 import jdk.tools.jlink.internal.StringTable;
 import jdk.tools.jlink.internal.Utils;
@@ -228,7 +228,7 @@
             }
         }
 
-        public byte[] transform(ModuleData resource, Pool out,
+        public byte[] transform(ModuleEntry resource, ModulePool out,
                 StringTable strings) throws IOException, Exception {
             byte[] content = resource.getBytes();
             ClassFile cf;
@@ -243,7 +243,7 @@
         }
 
         @SuppressWarnings("fallthrough")
-        private byte[] optimize(ModuleData resource, Pool resources,
+        private byte[] optimize(ModuleEntry resource, ModulePool resources,
                 StringTable strings,
                 Set<Integer> descriptorIndexes, byte[] content) throws Exception {
             DataInputStream stream = new DataInputStream(new ByteArrayInputStream(content));
@@ -348,27 +348,27 @@
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.COMPRESSOR);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.COMPRESSOR);
         return Collections.unmodifiableSet(set);
     }
 
     @Override
-    public void visit(Pool in, Pool result) {
+    public void visit(ModulePool in, ModulePool result) {
         CompactCPHelper visit = new CompactCPHelper();
-        in.visit((resource) -> {
-            ModuleData res = resource;
+        in.transformAndCopy((resource) -> {
+            ModuleEntry res = resource;
             if (predicate.test(resource.getPath()) && resource.getPath().endsWith(".class")) {
                 byte[] compressed = null;
                 try {
-                    compressed = visit.transform(resource, result, ((PoolImpl) in).getStringTable());
+                    compressed = visit.transform(resource, result, ((ModulePoolImpl) in).getStringTable());
                 } catch (Exception ex) {
                     throw new PluginException(ex);
                 }
-                res = PoolImpl.newCompressedResource(resource,
+                res = ModulePoolImpl.newCompressedResource(resource,
                         ByteBuffer.wrap(compressed), getName(), null,
-                        ((PoolImpl) in).getStringTable(), in.getByteOrder());
+                        ((ModulePoolImpl) in).getStringTable(), in.getByteOrder());
             }
             return res;
         }, result);
@@ -405,10 +405,10 @@
     }
 
     @Override
-    public void previsit(Pool resources, StringTable strings) {
+    public void previsit(ModulePool resources, StringTable strings) {
         CompactCPHelper preVisit = new CompactCPHelper();
-        for (ModuleData resource : resources.getContent()) {
-            if (resource.getType().equals(Pool.ModuleDataType.CLASS_OR_RESOURCE)
+        resources.entries().forEach(resource -> {
+            if (resource.getType().equals(ModuleEntry.Type.CLASS_OR_RESOURCE)
                     && resource.getPath().endsWith(".class") && predicate.test(resource.getPath())) {
                 try {
                     preVisit.transform(resource, null, strings);
@@ -416,6 +416,6 @@
                     throw new PluginException(ex);
                 }
             }
-        }
+        });
     }
 }
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripDebugPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripDebugPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -29,14 +29,12 @@
 import java.io.UncheckedIOException;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.Map;
 import java.util.Set;
 import java.util.function.Predicate;
 import jdk.internal.org.objectweb.asm.ClassReader;
 import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleData;
-import jdk.tools.jlink.plugin.Pool.ModuleDataType;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 
 /**
@@ -61,9 +59,9 @@
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.TRANSFORMER);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.TRANSFORMER);
         return Collections.unmodifiableSet(set);
     }
 
@@ -73,11 +71,11 @@
     }
 
     @Override
-    public void visit(Pool in, Pool out) {
+    public void visit(ModulePool in, ModulePool out) {
         //remove *.diz files as well as debug attributes.
-        in.visit((resource) -> {
-            ModuleData res = resource;
-            if (resource.getType().equals(ModuleDataType.CLASS_OR_RESOURCE)) {
+        in.transformAndCopy((resource) -> {
+            ModuleEntry res = resource;
+            if (resource.getType().equals(ModuleEntry.Type.CLASS_OR_RESOURCE)) {
                 String path = resource.getPath();
                 if (path.endsWith(".class")) {
                     if (path.endsWith("module-info.class")) {
@@ -87,7 +85,7 @@
                         ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
                         reader.accept(writer, ClassReader.SKIP_DEBUG);
                         byte[] content = writer.toByteArray();
-                        res = Pool.newResource(path, new ByteArrayInputStream(content), content.length);
+                        res = ModuleEntry.create(path, new ByteArrayInputStream(content), content.length);
                     }
                 }
             } else if (predicate.test(res.getPath())) {
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripNativeCommandsPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripNativeCommandsPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -26,9 +26,9 @@
 
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.Map;
 import java.util.Set;
-import jdk.tools.jlink.plugin.Pool;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 
 /**
@@ -45,16 +45,16 @@
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.FILTER);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.FILTER);
         return Collections.unmodifiableSet(set);
     }
 
     @Override
-    public void visit(Pool in, Pool out) {
-        in.visit((file) -> {
-            return file.getType() == Pool.ModuleDataType.NATIVE_CMD ? null : file;
+    public void visit(ModulePool in, ModulePool out) {
+        in.transformAndCopy((file) -> {
+            return file.getType() == ModuleEntry.Type.NATIVE_CMD ? null : file;
         }, out);
     }
 
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModuleDescriptorPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModuleDescriptorPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -36,6 +36,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
@@ -50,9 +51,10 @@
 
 import static jdk.internal.org.objectweb.asm.Opcodes.*;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 import jdk.tools.jlink.internal.plugins.SystemModuleDescriptorPlugin.Builder.*;
+import jdk.tools.jlink.plugin.ModuleEntry;
 
 /**
  * Jlink plugin to reconstitute module descriptors for installed modules.
@@ -81,8 +83,8 @@
     }
 
     @Override
-    public Set<PluginType> getType() {
-        return Collections.singleton(CATEGORY.TRANSFORMER);
+    public Set<Category> getType() {
+        return Collections.singleton(Category.TRANSFORMER);
     }
 
     @Override
@@ -96,9 +98,9 @@
     }
 
     @Override
-    public Set<STATE> getState() {
-        return enabled ? EnumSet.of(STATE.AUTO_ENABLED, STATE.FUNCTIONAL)
-                       : EnumSet.of(STATE.DISABLED);
+    public Set<State> getState() {
+        return enabled ? EnumSet.of(State.AUTO_ENABLED, State.FUNCTIONAL)
+                       : EnumSet.of(State.DISABLED);
     }
 
     @Override
@@ -110,7 +112,7 @@
 
 
     @Override
-    public void visit(Pool in, Pool out) {
+    public void visit(ModulePool in, ModulePool out) {
         if (!enabled) {
             throw new PluginException(NAME + " was set");
         }
@@ -119,13 +121,14 @@
 
         // generate the byte code to create ModuleDescriptors
         // skip parsing module-info.class and skip name check
-        for (Pool.Module module : in.getModules()) {
-            Pool.ModuleData data = module.get("module-info.class");
-            if (data == null) {
+        in.modules().forEach(module -> {
+            Optional<ModuleEntry> optData = module.findEntry("module-info.class");
+            if (! optData.isPresent()) {
                 // automatic module not supported yet
                 throw new PluginException("module-info.class not found for " +
                                           module.getName() + " module");
             }
+            ModuleEntry data = optData.get();
             assert module.getName().equals(data.getModule());
             try {
                 ByteArrayInputStream bain = new ByteArrayInputStream(data.getBytes());
@@ -141,7 +144,7 @@
                     ModuleInfoRewriter minfoWriter =
                         new ModuleInfoRewriter(bain, mbuilder.conceals());
                     // replace with the overridden version
-                    data = new Pool.ModuleData(data.getModule(),
+                    data = ModuleEntry.create(data.getModule(),
                                                data.getPath(),
                                                data.getType(),
                                                minfoWriter.stream(),
@@ -151,19 +154,17 @@
             } catch (IOException e) {
                 throw new PluginException(e);
             }
-
-        }
+        });
 
         // Generate the new class
         ClassWriter cwriter = builder.build();
-        for (Pool.ModuleData data : in.getContent()) {
+        in.entries().forEach(data -> {
             if (data.getPath().endsWith("module-info.class"))
-                continue;
-
+                return;
             if (builder.isOverriddenClass(data.getPath())) {
                 byte[] bytes = cwriter.toByteArray();
-                Pool.ModuleData ndata =
-                    new Pool.ModuleData(data.getModule(),
+                ModuleEntry ndata =
+                    ModuleEntry.create(data.getModule(),
                                         data.getPath(),
                                         data.getType(),
                                         new ByteArrayInputStream(bytes),
@@ -172,7 +173,7 @@
             } else {
                 out.add(data);
             }
-        }
+        });
     }
 
     /*
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ZipPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ZipPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -34,10 +34,9 @@
 import java.util.function.Predicate;
 import java.util.zip.Deflater;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.internal.PoolImpl;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleData;
-import jdk.tools.jlink.plugin.Pool.ModuleDataType;
+import jdk.tools.jlink.internal.ModulePoolImpl;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.TransformerPlugin;
 import jdk.tools.jlink.internal.Utils;
 
@@ -68,9 +67,9 @@
     }
 
     @Override
-    public Set<PluginType> getType() {
-        Set<PluginType> set = new HashSet<>();
-        set.add(CATEGORY.COMPRESSOR);
+    public Set<Category> getType() {
+        Set<Category> set = new HashSet<>();
+        set.add(Category.COMPRESSOR);
         return Collections.unmodifiableSet(set);
     }
 
@@ -124,16 +123,16 @@
     }
 
     @Override
-    public void visit(Pool in, Pool out) {
-        in.visit((resource) -> {
-            ModuleData res = resource;
-            if (resource.getType().equals(ModuleDataType.CLASS_OR_RESOURCE)
+    public void visit(ModulePool in, ModulePool out) {
+        in.transformAndCopy((resource) -> {
+            ModuleEntry res = resource;
+            if (resource.getType().equals(ModuleEntry.Type.CLASS_OR_RESOURCE)
                     && predicate.test(resource.getPath())) {
                 byte[] compressed;
                 compressed = compress(resource.getBytes());
-                res = PoolImpl.newCompressedResource(resource,
+                res = ModulePoolImpl.newCompressedResource(resource,
                         ByteBuffer.wrap(compressed), getName(), null,
-                        ((PoolImpl) in).getStringTable(), in.getByteOrder());
+                        ((ModulePoolImpl) in).getStringTable(), in.getByteOrder());
             }
             return res;
         }, out);
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -26,9 +26,9 @@
 
 import java.util.Objects;
 import jdk.tools.jlink.plugin.TransformerPlugin;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleData;
-import jdk.tools.jlink.internal.PoolImpl;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.ModulePool;
+import jdk.tools.jlink.internal.ModulePoolImpl;
 
 /**
  * Extend this class to develop your own plugin in order to transform jimage
@@ -41,17 +41,17 @@
     }
 
     @Override
-    public void visit(Pool allContent, Pool outResources) {
+    public void visit(ModulePool allContent, ModulePool outResources) {
         Objects.requireNonNull(allContent);
         Objects.requireNonNull(outResources);
-        PoolImpl resources = new PoolImpl(allContent.getByteOrder());
-        for(ModuleData md : allContent.getContent()) {
-            if(md.getType().equals(Pool.ModuleDataType.CLASS_OR_RESOURCE)) {
+        ModulePoolImpl resources = new ModulePoolImpl(allContent.getByteOrder());
+        allContent.entries().forEach(md -> {
+            if(md.getType().equals(ModuleEntry.Type.CLASS_OR_RESOURCE)) {
                 resources.add(md);
             } else {
                 outResources.add(md);
             }
-        }
+        });
         AsmPools pools = new AsmPools(resources);
         visit(pools);
         pools.fillOutputResources(outResources);
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPool.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPool.java	Tue May 17 05:38:15 2016 -0700
@@ -24,13 +24,12 @@
  */
 package jdk.tools.jlink.internal.plugins.asm;
 
-import java.io.InputStream;
-import java.nio.ByteBuffer;
 import java.util.Collection;
 import java.util.List;
 import jdk.internal.org.objectweb.asm.ClassReader;
 import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.tools.jlink.plugin.Pool;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.ModulePool;
 
 /**
  * A pool of ClassReader and other resource files.
@@ -138,14 +137,14 @@
          * @return The ClassReader or null if the class is not found.
          * @throws jdk.tools.jlink.plugin.PluginException
          */
-        public ClassReader getClassReader(Pool.ModuleData res);
+        public ClassReader getClassReader(ModuleEntry res);
 
         /**
          * Returns all the classes contained in the writable pool.
          *
          * @return The collection of classes.
          */
-        public Collection<Pool.ModuleData> getClasses();
+        public Collection<ModuleEntry> getClasses();
     }
 
     /**
@@ -185,14 +184,14 @@
          * @param res The java resource
          * @return The Resource or null if the resource is not found.
          */
-        public ResourceFile getResourceFile(Pool.ModuleData res);
+        public ResourceFile getResourceFile(ModuleEntry res);
 
         /**
          * Returns all the resources contained in the writable pool.
          *
          * @return The array of resources.
          */
-        public Collection<Pool.ModuleData> getResourceFiles();
+        public Collection<ModuleEntry> getResourceFiles();
     }
 
     /**
@@ -206,7 +205,7 @@
          * @return The resource paths ordered in the way to use for storage in the jimage.
          * @throws jdk.tools.jlink.plugin.PluginException
          */
-        public List<String> sort(Pool resources);
+        public List<String> sort(ModulePool resources);
     }
 
     /**
@@ -237,7 +236,7 @@
      *
      * @return The classes.
      */
-    public Collection<Pool.ModuleData> getClasses();
+    public Collection<ModuleEntry> getClasses();
 
     /**
      * Returns the resources contained in the pool. Resources are all the file
@@ -245,7 +244,7 @@
      *
      * @return The array of resource files.
      */
-    public Collection<Pool.ModuleData> getResourceFiles();
+    public Collection<ModuleEntry> getResourceFiles();
 
     /**
      * Retrieves a resource based on the binary name. This name doesn't contain
@@ -266,7 +265,7 @@
      * @param res The resource
      * @return The resource file or null if it doesn't exist.
      */
-    public ResourceFile getResourceFile(Pool.ModuleData res);
+    public ResourceFile getResourceFile(ModuleEntry res);
 
     /**
      * Retrieve a ClassReader from the pool.
@@ -284,7 +283,7 @@
      * @return A reader or null if the class is unknown
      * @throws jdk.tools.jlink.plugin.PluginException
      */
-    public ClassReader getClassReader(Pool.ModuleData res);
+    public ClassReader getClassReader(ModuleEntry res);
 
     /**
      * To visit the set of ClassReaders.
@@ -310,6 +309,6 @@
      * @param output The pool used to fill the jimage.
      * @throws jdk.tools.jlink.plugin.PluginException
      */
-    public void fillOutputResources(Pool output);
+    public void fillOutputResources(ModulePool output);
 
 }
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPoolImpl.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPoolImpl.java	Tue May 17 05:38:15 2016 -0700
@@ -41,15 +41,14 @@
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Objects;
-import java.util.Optional;
 import java.util.Set;
 import jdk.internal.org.objectweb.asm.ClassReader;
 import jdk.internal.org.objectweb.asm.ClassWriter;
 import jdk.tools.jlink.internal.ImageFileCreator;
-import jdk.tools.jlink.internal.PoolImpl;
+import jdk.tools.jlink.internal.ModulePoolImpl;
+import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleData;
+import jdk.tools.jlink.plugin.ModulePool;
 
 /**
  * A pool of ClassReader and other resource files. This class allows to
@@ -94,7 +93,7 @@
             }
 
             byte[] content = writer.toByteArray();
-            ModuleData res = Pool.newResource(path,
+            ModuleEntry res = ModuleEntry.create(path,
                     new ByteArrayInputStream(content), content.length);
             transformedClasses.put(className, res);
         }
@@ -108,7 +107,7 @@
         public void forgetClass(String className) {
             Objects.requireNonNull(className);
             // do we have a resource?
-            ModuleData res = transformedClasses.get(className);
+            ModuleEntry res = transformedClasses.get(className);
             if (res == null) {
                 res = inputClasses.get(className);
                 if (res == null) {
@@ -130,7 +129,7 @@
         @Override
         public ClassReader getClassReader(String binaryName) {
             Objects.requireNonNull(binaryName);
-            ModuleData res = transformedClasses.get(binaryName);
+            ModuleEntry res = transformedClasses.get(binaryName);
             ClassReader reader = null;
             if (res != null) {
                 reader = getClassReader(res);
@@ -144,16 +143,16 @@
          * @return The array of transformed classes.
          */
         @Override
-        public Collection<ModuleData> getClasses() {
-            List<ModuleData> classes = new ArrayList<>();
-            for (Entry<String, ModuleData> entry : transformedClasses.entrySet()) {
+        public Collection<ModuleEntry> getClasses() {
+            List<ModuleEntry> classes = new ArrayList<>();
+            for (Entry<String, ModuleEntry> entry : transformedClasses.entrySet()) {
                 classes.add(entry.getValue());
             }
             return classes;
         }
 
         @Override
-        public ClassReader getClassReader(ModuleData res) {
+        public ClassReader getClassReader(ModuleEntry res) {
             return newClassReader(res.getBytes());
         }
     }
@@ -176,7 +175,7 @@
         public void addResourceFile(ResourceFile resFile) {
             Objects.requireNonNull(resFile);
             String path = toResourceNamePath(resFile.getPath());
-            ModuleData res = Pool.newResource(path, resFile.getContent());
+            ModuleEntry res = ModuleEntry.create(path, resFile.getContent());
             transformedResources.put(resFile.getPath(), res);
         }
 
@@ -191,7 +190,7 @@
             Objects.requireNonNull(resourceName);
             String path = toResourceNamePath(resourceName);
             // do we have a resource?
-            ModuleData res = transformedResources.get(resourceName);
+            ModuleEntry res = transformedResources.get(resourceName);
             if (res == null) {
                 res = inputResources.get(resourceName);
                 if (res == null) {
@@ -212,7 +211,7 @@
         @Override
         public ResourceFile getResourceFile(String name) {
             Objects.requireNonNull(name);
-            ModuleData res = transformedResources.get(name);
+            ModuleEntry res = transformedResources.get(name);
             ResourceFile resFile = null;
             if (res != null) {
                 resFile = getResourceFile(res);
@@ -226,24 +225,24 @@
          * @return The array of transformed classes.
          */
         @Override
-        public Collection<ModuleData> getResourceFiles() {
-            List<ModuleData> resources = new ArrayList<>();
-            for (Entry<String, ModuleData> entry : transformedResources.entrySet()) {
+        public Collection<ModuleEntry> getResourceFiles() {
+            List<ModuleEntry> resources = new ArrayList<>();
+            for (Entry<String, ModuleEntry> entry : transformedResources.entrySet()) {
                 resources.add(entry.getValue());
             }
             return resources;
         }
 
         @Override
-        public ResourceFile getResourceFile(ModuleData res) {
+        public ResourceFile getResourceFile(ModuleEntry res) {
             return new ResourceFile(toJavaBinaryResourceName(res.getPath()),
                     res.getBytes());
         }
     }
 
-    private final Pool jimageResources;
-    private final Map<String, ModuleData> inputClasses;
-    private final Map<String, ModuleData> inputResources;
+    private final ModulePool jimageResources;
+    private final Map<String, ModuleEntry> inputClasses;
+    private final Map<String, ModuleEntry> inputResources;
     private final Map<String, String> inputClassPackageMapping;
     private final Map<String, String> inputOtherPackageMapping;
 
@@ -254,9 +253,9 @@
 
     private Sorter sorter;
 
-    private final Map<String, ModuleData> transformedClasses
+    private final Map<String, ModuleEntry> transformedClasses
             =            new LinkedHashMap<>();
-    private final Map<String, ModuleData> transformedResources
+    private final Map<String, ModuleEntry> transformedResources
             =            new LinkedHashMap<>();
     private final List<String> forgetResources = new ArrayList<>();
     private final Map<String, String> newPackageMapping = new HashMap<>();
@@ -274,7 +273,7 @@
      * @param pools The resource pools.
      * @param descriptor The module descriptor.
      */
-    AsmPoolImpl(Pool inputResources, String moduleName,
+    AsmPoolImpl(ModulePool inputResources, String moduleName,
             AsmPools pools,
             ModuleDescriptor descriptor) {
         Objects.requireNonNull(inputResources);
@@ -285,11 +284,11 @@
         this.moduleName = moduleName;
         this.pools = pools;
         this.descriptor = descriptor;
-        Map<String, ModuleData> classes = new LinkedHashMap<>();
-        Map<String, ModuleData> resources = new LinkedHashMap<>();
+        Map<String, ModuleEntry> classes = new LinkedHashMap<>();
+        Map<String, ModuleEntry> resources = new LinkedHashMap<>();
         Map<String, String> packageClassToModule = new HashMap<>();
         Map<String, String> packageOtherToModule = new HashMap<>();
-        for (ModuleData res : inputResources.getContent()) {
+        inputResources.entries().forEach(res -> {
             if (res.getPath().endsWith(".class")) {
                 classes.put(toJavaBinaryClassName(res.getPath()), res);
             } else {
@@ -305,7 +304,7 @@
                     packageOtherToModule.put(split[1], res.getModule());
                 }
             }
-        }
+        });
         this.inputClasses = Collections.unmodifiableMap(classes);
         this.inputResources = Collections.unmodifiableMap(resources);
 
@@ -356,7 +355,7 @@
      * @return The array of classes.
      */
     @Override
-    public Collection<ModuleData> getClasses() {
+    public Collection<ModuleEntry> getClasses() {
         return inputClasses.values();
     }
 
@@ -367,7 +366,7 @@
      * @return The array of classes.
      */
     @Override
-    public Collection<ModuleData> getResourceFiles() {
+    public Collection<ModuleEntry> getResourceFiles() {
         return inputResources.values();
     }
 
@@ -385,7 +384,7 @@
     @Override
     public ResourceFile getResourceFile(String binaryName) {
         Objects.requireNonNull(binaryName);
-        ModuleData res = inputResources.get(binaryName);
+        ModuleEntry res = inputResources.get(binaryName);
         ResourceFile resFile = null;
         if (res != null) {
             resFile = getResourceFile(res);
@@ -402,7 +401,7 @@
     @Override
     public ClassReader getClassReader(String binaryName) {
         Objects.requireNonNull(binaryName);
-        ModuleData res = inputClasses.get(binaryName);
+        ModuleEntry res = inputClasses.get(binaryName);
         ClassReader reader = null;
         if (res != null) {
             reader = getClassReader(res);
@@ -411,13 +410,13 @@
     }
 
     @Override
-    public ResourceFile getResourceFile(ModuleData res) {
+    public ResourceFile getResourceFile(ModuleEntry res) {
         return new ResourceFile(toJavaBinaryResourceName(res.getPath()),
                 res.getBytes());
     }
 
     @Override
-    public ClassReader getClassReader(ModuleData res) {
+    public ClassReader getClassReader(ModuleEntry res) {
         return newClassReader(res.getBytes());
     }
 
@@ -505,7 +504,7 @@
     @Override
     public void visitClassReaders(ClassReaderVisitor visitor) {
         Objects.requireNonNull(visitor);
-        for (ModuleData res : getClasses()) {
+        for (ModuleEntry res : getClasses()) {
             ClassReader reader = newClassReader(res.getBytes());
             ClassWriter writer = visitor.visit(reader);
             if (writer != null) {
@@ -523,7 +522,7 @@
     @Override
     public void visitResourceFiles(ResourceFileVisitor visitor) {
         Objects.requireNonNull(visitor);
-        for (ModuleData resource : getResourceFiles()) {
+        for (ModuleEntry resource : getResourceFiles()) {
             ResourceFile resFile
                     = new ResourceFile(toJavaBinaryResourceName(resource.getPath()),
                             resource.getBytes());
@@ -540,18 +539,18 @@
      * been set, it is used to sort the returned resources.     *
      */
     @Override
-    public void fillOutputResources(Pool outputResources) {
+    public void fillOutputResources(ModulePool outputResources) {
         List<String> added = new ArrayList<>();
         // If the sorter is null, use the input order.
         // New resources are added at the end
         // First input classes that have not been removed
-        Pool output = new PoolImpl(outputResources.getByteOrder(),
-                ((PoolImpl)outputResources).getStringTable());
-        for (ModuleData inResource : jimageResources.getContent()) {
+        ModulePool output = new ModulePoolImpl(outputResources.getByteOrder(),
+                ((ModulePoolImpl)outputResources).getStringTable());
+        jimageResources.entries().forEach(inResource -> {
             if (!forgetResources.contains(inResource.getPath())) {
-                ModuleData resource = inResource;
+                ModuleEntry resource = inResource;
                 // Do we have a transformed class with the same name?
-                ModuleData res = transformedResources.
+                ModuleEntry res = transformedResources.
                         get(toJavaBinaryResourceName(inResource.getPath()));
                 if (res != null) {
                     resource = res;
@@ -565,10 +564,10 @@
                 output.add(resource);
                 added.add(resource.getPath());
             }
-        }
+        });
         // Then new resources
-        for (Map.Entry<String, ModuleData> entry : transformedResources.entrySet()) {
-            ModuleData resource = entry.getValue();
+        for (Map.Entry<String, ModuleEntry> entry : transformedResources.entrySet()) {
+            ModuleEntry resource = entry.getValue();
             if (!forgetResources.contains(resource.getPath())) {
                 if (!added.contains(resource.getPath())) {
                     output.add(resource);
@@ -576,8 +575,8 @@
             }
         }
         // And new classes
-        for (Map.Entry<String, ModuleData> entry : transformedClasses.entrySet()) {
-            ModuleData resource = entry.getValue();
+        for (Map.Entry<String, ModuleEntry> entry : transformedClasses.entrySet()) {
+            ModuleEntry resource = entry.getValue();
             if (!forgetResources.contains(resource.getPath())) {
                 if (!added.contains(resource.getPath())) {
                     output.add(resource);
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPools.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPools.java	Tue May 17 05:38:15 2016 -0700
@@ -41,11 +41,11 @@
 import java.util.Set;
 import jdk.internal.org.objectweb.asm.ClassReader;
 import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.tools.jlink.internal.PoolImpl;
+import jdk.tools.jlink.internal.ModulePoolImpl;
 import jdk.tools.jlink.internal.plugins.asm.AsmPool.Sorter;
+import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.Pool;
-import jdk.tools.jlink.plugin.Pool.ModuleData;
+import jdk.tools.jlink.plugin.ModulePool;
 
 /**
  * A container for pools of ClassReader and other resource files. A pool of all
@@ -97,10 +97,10 @@
             }
 
             @Override
-            public Collection<Pool.ModuleData> getClasses() {
-                List<Pool.ModuleData> all = new ArrayList<>();
+            public Collection<ModuleEntry> getClasses() {
+                List<ModuleEntry> all = new ArrayList<>();
                 visitAllPools((AsmModulePool pool) -> {
-                    for (Pool.ModuleData rf : pool.getTransformedClasses().getClasses()) {
+                    for (ModuleEntry rf : pool.getTransformedClasses().getClasses()) {
                         all.add(rf);
                     }
                 });
@@ -108,7 +108,7 @@
             }
 
             @Override
-            public ClassReader getClassReader(Pool.ModuleData res) {
+            public ClassReader getClassReader(ModuleEntry res) {
                 return visitPools((AsmModulePool pool) -> {
                     return pool.getTransformedClasses().getClassReader(res);
                 });
@@ -140,10 +140,10 @@
             }
 
             @Override
-            public Collection<Pool.ModuleData> getResourceFiles() {
-                List<Pool.ModuleData> all = new ArrayList<>();
+            public Collection<ModuleEntry> getResourceFiles() {
+                List<ModuleEntry> all = new ArrayList<>();
                 visitAllPools((AsmModulePool pool) -> {
-                    for (Pool.ModuleData rf : pool.getTransformedResourceFiles().getResourceFiles()) {
+                    for (ModuleEntry rf : pool.getTransformedResourceFiles().getResourceFiles()) {
                         all.add(rf);
                     }
                 });
@@ -151,7 +151,7 @@
             }
 
             @Override
-            public ResourceFile getResourceFile(Pool.ModuleData res) {
+            public ResourceFile getResourceFile(ModuleEntry res) {
                 return visitPools((AsmModulePool pool) -> {
                     return pool.getTransformedResourceFiles().getResourceFile(res);
                 });
@@ -175,10 +175,10 @@
         }
 
         @Override
-        public Collection<Pool.ModuleData> getClasses() {
-            List<Pool.ModuleData> all = new ArrayList<>();
+        public Collection<ModuleEntry> getClasses() {
+            List<ModuleEntry> all = new ArrayList<>();
             visitAllPools((AsmModulePool pool) -> {
-                for (Pool.ModuleData rf : pool.getClasses()) {
+                for (ModuleEntry rf : pool.getClasses()) {
                     all.add(rf);
                 }
             });
@@ -186,10 +186,10 @@
         }
 
         @Override
-        public Collection<Pool.ModuleData> getResourceFiles() {
-            List<Pool.ModuleData> all = new ArrayList<>();
+        public Collection<ModuleEntry> getResourceFiles() {
+            List<ModuleEntry> all = new ArrayList<>();
             visitAllPools((AsmModulePool pool) -> {
-                for (Pool.ModuleData rf : pool.getResourceFiles()) {
+                for (ModuleEntry rf : pool.getResourceFiles()) {
                     all.add(rf);
                 }
             });
@@ -211,14 +211,14 @@
         }
 
         @Override
-        public ResourceFile getResourceFile(Pool.ModuleData res) {
+        public ResourceFile getResourceFile(ModuleEntry res) {
             return visitPools((AsmModulePool pool) -> {
                 return pool.getResourceFile(res);
             });
         }
 
         @Override
-        public ClassReader getClassReader(Pool.ModuleData res) {
+        public ClassReader getClassReader(ModuleEntry res) {
             return visitPoolsEx((AsmModulePool pool) -> {
                 return pool.getClassReader(res);
             });
@@ -239,7 +239,7 @@
         }
 
         @Override
-        public void fillOutputResources(Pool outputResources) {
+        public void fillOutputResources(ModulePool outputResources) {
             AsmPools.this.fillOutputResources(outputResources);
         }
 
@@ -324,15 +324,15 @@
      *
      * @param inputResources The raw resources to build the pool from.
      */
-    public AsmPools(Pool inputResources) {
+    public AsmPools(ModulePool inputResources) {
         Objects.requireNonNull(inputResources);
-        Map<String, Pool> resPools = new LinkedHashMap<>();
+        Map<String, ModulePool> resPools = new LinkedHashMap<>();
         Map<String, ModuleDescriptor> descriptors = new HashMap<>();
-        for (Pool.ModuleData res : inputResources.getContent()) {
-            Pool p = resPools.get(res.getModule());
+        inputResources.entries().forEach(res -> {
+            ModulePool p = resPools.get(res.getModule());
             if (p == null) {
-                p = new PoolImpl(inputResources.getByteOrder(),
-                        ((PoolImpl)inputResources).getStringTable());
+                p = new ModulePoolImpl(inputResources.getByteOrder(),
+                        ((ModulePoolImpl)inputResources).getStringTable());
                 resPools.put(res.getModule(), p);
             }
             if (res.getPath().endsWith("module-info.class")) {
@@ -341,11 +341,11 @@
                 descriptors.put(res.getModule(), descriptor);
             }
             p.add(res);
-        }
+        });
         poolsArray = new AsmModulePool[resPools.size()];
         int i = 0;
 
-        for (Entry<String, Pool> entry : resPools.entrySet()) {
+        for (Entry<String, ModulePool> entry : resPools.entrySet()) {
             ModuleDescriptor descriptor = descriptors.get(entry.getKey());
             if (descriptor == null) {
                 throw new PluginException("module-info.class not found for " + entry.getKey() + " module");
@@ -405,7 +405,7 @@
      *
      * @param outputResources The pool used to fill the jimage.
      */
-    public void fillOutputResources(Pool outputResources) {
+    public void fillOutputResources(ModulePool outputResources) {
         // First sort modules
         List<String> modules = new ArrayList<>();
         for (String k : pools.keySet()) {
@@ -414,8 +414,8 @@
         if (moduleSorter != null) {
             modules = moduleSorter.sort(modules);
         }
-        Pool output = new PoolImpl(outputResources.getByteOrder(),
-                ((PoolImpl)outputResources).getStringTable());
+        ModulePool output = new ModulePoolImpl(outputResources.getByteOrder(),
+                ((ModulePoolImpl)outputResources).getStringTable());
         for (String mn : modules) {
             AsmPool pool = pools.get(mn);
             pool.fillOutputResources(output);
@@ -423,17 +423,17 @@
         sort(outputResources, output, global.sorter);
     }
 
-    static void sort(Pool outputResources,
-            Pool transientOutput, Sorter sorter) {
+    static void sort(ModulePool outputResources,
+            ModulePool transientOutput, Sorter sorter) {
         if (sorter != null) {
             List<String> order = sorter.sort(transientOutput);
             for (String s : order) {
-                outputResources.add(transientOutput.get(s));
+                outputResources.add(transientOutput.findEntry(s).get());
             }
         } else {
-            for (ModuleData res : transientOutput.getContent()) {
+            transientOutput.entries().forEach(res-> {
                 outputResources.add(res);
-            }
+            });
         }
     }
 
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/ExecutableImage.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/ExecutableImage.java	Tue May 17 05:38:15 2016 -0700
@@ -24,66 +24,41 @@
  */
 package jdk.tools.jlink.plugin;
 
-import java.nio.file.Files;
 import java.nio.file.Path;
-import java.util.Collections;
 import java.util.List;
-import java.util.Objects;
 import java.util.Set;
 
 /**
- * An executable runtime image. Instance of this class contains the information
- * needed to create image processes.
+ * An executable runtime image. Contains the information about the executable
+ * image created.
  */
-public abstract class ExecutableImage {
-
-    private final Path home;
-    private final List<String> args;
-    private final Set<String> modules;
-
-    protected ExecutableImage(Path home, Set<String> modules,
-            List<String> args) {
-        Objects.requireNonNull(home);
-        Objects.requireNonNull(args);
-        if (!Files.exists(home)) {
-            throw new IllegalArgumentException("Invalid image home");
-        }
-        this.home = home;
-        this.modules = Collections.unmodifiableSet(modules);
-        this.args = Collections.unmodifiableList(args);
-    }
+public interface ExecutableImage {
 
     /**
      * Image home directory,
      *
      * @return The home directory.
      */
-    public Path getHome() {
-        return home;
-    }
+    public Path getHome();
 
     /**
      * The names of the modules located in the image.
      *
      * @return The set of modules.
      */
-    public Set<String> getModules() {
-        return modules;
-    }
+    public Set<String> getModules();
 
     /**
      * The list of arguments required to execute the image.
      *
      * @return The list of arguments.
      */
-    public List<String> getExecutionArgs() {
-        return args;
-    }
+    public List<String> getExecutionArgs();
 
     /**
      * Store new arguments required to execute the image.
      *
      * @param args Additional arguments
      */
-    public abstract void storeLaunchArgs(List<String> args);
+    public void storeLaunchArgs(List<String> args);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/LinkModule.java	Tue May 17 05:38:15 2016 -0700
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.tools.jlink.plugin;
+
+import java.lang.module.ModuleDescriptor;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Stream;
+
+/**
+  * Link-time representation of a Java module.
+  */
+public interface LinkModule {
+
+    /**
+     * The module name.
+     *
+     * @return The name.
+     */
+    public String getName();
+
+    /**
+     * Retrieves a LinkModuleEntry from the given path (e.g:
+     * /mymodule/com.foo.bar/MyClass.class)
+     *
+     * @param path The piece of data path.
+     * @return A LinkModuleEntry of the given path, if found.
+     */
+    public Optional<ModuleEntry> findEntry(String path);
+
+    /**
+     * The module descriptor of this module.
+     *
+     * @return The module descriptor.
+     */
+    public ModuleDescriptor getDescriptor();
+
+    /**
+     * Add a LinkModuleEntry to this module.
+     *
+     * @param data The LinkModuleEntry to add.
+     */
+    public void add(ModuleEntry data);
+
+    /**
+     * Retrieves all the packages located in this module.
+     *
+     * @return The set of packages.
+     */
+    public Set<String> getAllPackages();
+
+    /**
+     * Retrieves the stream of LinkModuleEntry.
+     *
+     * @return The LinkModuleEntry stream.
+     */
+    public Stream<? extends ModuleEntry> entries();
+
+    /**
+     * Return the number of LinkModuleEntry count in this LinkModule.
+     *
+     * @return the entry count.
+     */
+    public int getEntryCount();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/ModuleEntry.java	Tue May 17 05:38:15 2016 -0700
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.tools.jlink.plugin;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Objects;
+import jdk.tools.jlink.internal.ImageFileCreator;
+import jdk.tools.jlink.internal.ModuleEntryImpl;
+
+/**
+ * A LinkModuleEntry is the elementary unit of data inside an image. It is
+ * generally a file. e.g.: a java class file, a resource file, a shared library,
+ * ...
+ * <br>
+ * A LinkModuleEntry is identified by a path of the form:
+ * <ul>
+ * <li>For jimage content: /{module name}/{package1}/.../{packageN}/{file
+ * name}</li>
+ * <li>For other files (shared lib, launchers, config, ...):/{module name}/
+ * {@literal bin|conf|native}/{dir1}>/.../{dirN}/{file name}</li>
+ * </ul>
+ */
+public interface ModuleEntry {
+
+    /**
+     * Type of module data.
+     * <li>
+     * <ul>CLASS_OR_RESOURCE: A java class or resource file.</ul>
+     * <ul>CONFIG: A configuration file.</ul>
+     * <ul>NATIVE_CMD: A native process launcher.</ul>
+     * <ul>NATIVE_LIB: A native library.</ul>
+     * <ul>OTHER: Other kind of file.</ul>
+     * </li>
+     */
+    public enum Type {
+        CLASS_OR_RESOURCE,
+        CONFIG,
+        NATIVE_CMD,
+        NATIVE_LIB,
+        OTHER
+    }
+    /**
+     * The LinkModuleEntry module name.
+     *
+     * @return The module name.
+     */
+    public String getModule();
+
+    /**
+     * The LinkModuleEntry path.
+     *
+     * @return The module path.
+     */
+    public String getPath();
+
+    /**
+     * The LinkModuleEntry's type.
+     *
+     * @return The data type.
+     */
+    public Type getType();
+
+    /**
+     * The LinkModuleEntry content as an array of byte.
+     *
+     * @return An Array of bytes.
+     */
+    public byte[] getBytes();
+
+    /**
+     * The LinkModuleEntry content length.
+     *
+     * @return The length.
+     */
+    public long getLength();
+
+    /**
+     * The LinkModuleEntry stream.
+     *
+     * @return The module data stream.
+     */
+    public InputStream stream();
+
+
+    /**
+     * Create a LinkModuleEntry located inside a jimage file. Such
+     * LinkModuleEntry has a Type being equals to CLASS_OR_RESOURCE.
+     *
+     * @param path The complete resource path (contains the module radical).
+     * @param content The resource content.
+     * @param size The content size.
+     * @return A new LinkModuleEntry.
+     */
+    public static ModuleEntry create(String path, InputStream content, long size) {
+        Objects.requireNonNull(path);
+        Objects.requireNonNull(content);
+        String[] split = ImageFileCreator.splitPath(path);
+        String module = split[0];
+        return new ModuleEntryImpl(module, path, Type.CLASS_OR_RESOURCE, content, size);
+    }
+
+    /**
+     * Create a LinkModuleEntry for a file that will be located inside a jimage
+     * file.
+     *
+     * @param path The resource path.
+     * @param content The resource content.
+     * @return A new LinkModuleEntry.
+     */
+    public static ModuleEntry create(String path, byte[] content) {
+        return create(path, new ByteArrayInputStream(content),
+                content.length);
+    }
+
+    /**
+     * Create a LinkModuleEntry for a file that will be located outside a jimage
+     * file.
+     *
+     * @param module The module in which this files is located.
+     * @param path The file path locator (doesn't contain the module name).
+     * @param type The LinkModuleEntry type.
+     * @param content The file content.
+     * @param size The content size.
+     * @return A new LinkModuleEntry.
+     */
+    public static ModuleEntry create(String module, String path, ModuleEntry.Type type,
+            InputStream content, long size) {
+        Objects.requireNonNull(path);
+        Objects.requireNonNull(content);
+        return new ModuleEntryImpl(module, path, type, content, size);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/ModulePool.java	Tue May 17 05:38:15 2016 -0700
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.tools.jlink.plugin;
+
+import java.nio.ByteOrder;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Function;
+import java.util.stream.Stream;
+
+/**
+ * Pool of module data.
+ */
+public interface ModulePool {
+/**
+     * Is this a read-only ModulePool?
+     *
+     * @return true if this is a read-only configuration.
+     */
+    public boolean isReadOnly();
+
+    /**
+     * Add a ModuleEntry.
+     *
+     * @param data The ModuleEntry to add.
+     */
+    public void add(ModuleEntry data);
+    /**
+     * Retrieves the module for the provided name.
+     *
+     * @param name The module name
+     * @return the module of matching name, if found
+     */
+    public Optional<LinkModule> findModule(String name);
+
+    /**
+     * The stream of modules contained in this ModulePool.
+     *
+     * @return The stream of modules.
+     */
+    public Stream<? extends LinkModule> modules();
+
+    /**
+     * Return the number of LinkModule count in this ModulePool.
+     *
+     * @return the module count.
+     */
+    public int getModuleCount();
+
+    /**
+     * Get all ModuleEntry contained in this ModulePool instance.
+     *
+     * @return The stream of LinkModuleEntries.
+     */
+    public Stream<? extends ModuleEntry> entries();
+
+    /**
+     * Return the number of ModuleEntry count in this ModulePool.
+     *
+     * @return the entry count.
+     */
+    public int getEntryCount();
+
+    /**
+     * Get the ModuleEntry for the passed path.
+     *
+     * @param path A data path
+     * @return A ModuleEntry instance or null if the data is not found
+     */
+   public Optional<ModuleEntry> findEntry(String path);
+
+    /**
+     * Check if the ModulePool contains the given ModuleEntry.
+     *
+     * @param data The module data to check existence for.
+     * @return The module data or null if not found.
+     */
+    public boolean contains(ModuleEntry data);
+
+    /**
+     * Check if the ModulePool contains some content at all.
+     *
+     * @return True, no content, false otherwise.
+     */
+    public boolean isEmpty();
+
+    /**
+     * Visit each ModuleEntry in this ModulePool to transform it and copy
+     * the transformed ModuleEntry to the output ModulePool.
+     *
+     * @param transform The function called for each ModuleEntry found in the
+     * ModulePool. The transform function should return a ModuleEntry
+     * instance which will be added to the output or it should return null if
+     * the passed ModuleEntry is to be ignored for the output.
+     *
+     * @param output The ModulePool to be filled with Visitor returned
+     * ModuleEntry.
+     */
+    public void transformAndCopy(Function<ModuleEntry, ModuleEntry> transform, ModulePool output);
+
+    /**
+     * The ByteOrder currently in use when generating the jimage file.
+     *
+     * @return The ByteOrder.
+     */
+    public ByteOrder getByteOrder();
+
+    /**
+     * Release properties such as OS, CPU name, version etc.
+     *
+     * @return the release properties
+     */
+    public Map<String, String> getReleaseProperties();
+}
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Plugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Plugin.java	Tue May 17 05:38:15 2016 -0700
@@ -26,7 +26,6 @@
 
 import java.util.Collections;
 import java.util.EnumSet;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import jdk.tools.jlink.internal.plugins.PluginsResourceBundle;
@@ -37,14 +36,6 @@
 public interface Plugin {
 
     /**
-     * Type of plugin.
-     */
-    public interface PluginType {
-
-        public String getName();
-    }
-
-    /**
      * Order of categories:
      * <ol>
      * <li>FILTER: Filter in/out resources or files.</li>
@@ -53,28 +44,29 @@
      * <li>MODULEINFO_TRANSFORMER: Transform only module-info.class</li>
      * <li>SORTER: Sort resources within the resource container.</li>
      * <li>COMPRESSOR: Compress resource within the resouce containers.</li>
+     * <li>METAINFO_ADDER: Added meta info (like release, copyright etc.)</li>
      * <li>VERIFIER: Does some image verification.</li>
      * <li>PROCESSOR: Does some post processing on image.</li>
      * <li>PACKAGER: Final processing</li>
      * </ol>
      */
-    public enum CATEGORY implements PluginType {
+    public enum Category {
         FILTER("FILTER"),
         TRANSFORMER("TRANSFORMER"),
         MODULEINFO_TRANSFORMER("MODULEINFO_TRANSFORMER"),
         SORTER("SORTER"),
         COMPRESSOR("COMPRESSOR"),
+        METAINFO_ADDER("METAINFO_ADDER"),
         VERIFIER("VERIFIER"),
         PROCESSOR("PROCESSOR"),
         PACKAGER("PACKAGER");
 
         private final String name;
 
-        CATEGORY(String name) {
+        Category(String name) {
             this.name = name;
         }
 
-        @Override
         public String getName() {
             return name;
         }
@@ -91,7 +83,7 @@
      * {@link #getStateDescription() getStateDescription} method</li>
      * </ul>
      */
-    public enum STATE {
+    public enum State {
         DISABLED,
         AUTO_ENABLED,
         FUNCTIONAL
@@ -101,7 +93,7 @@
      * The Plugin set of types.
      * @return The set of types.
      */
-    public default Set<PluginType> getType() {
+    public default Set<Category> getType() {
         return Collections.emptySet();
     }
 
@@ -109,8 +101,8 @@
      * The Plugin set of states.
      * @return The set of states.
      */
-    public default Set<STATE> getState() {
-        return EnumSet.of(STATE.FUNCTIONAL);
+    public default Set<State> getState() {
+        return EnumSet.of(State.FUNCTIONAL);
     }
 
     /**
@@ -191,7 +183,7 @@
      * @return A status description.
      */
     public default String getStateDescription() {
-        return getState().contains(STATE.FUNCTIONAL)
+        return getState().contains(State.FUNCTIONAL)
                 ? PluginsResourceBundle.getMessage("main.status.ok")
                 : PluginsResourceBundle.getMessage("main.status.not.ok");
     }
@@ -206,18 +198,4 @@
      */
     public default void configure(Map<String, String> config) {
     }
-
-    /**
-     * Configure the plugin based on the passed configuration.
-     * This method is called prior to invoke the plugin.
-     *
-     * @param config The plugin configuration.
-     * @param ctx The plugin context
-     * @throws IllegalArgumentException if a mandatory argument is missing or
-     * if an argument has invalid value.
-     *
-     */
-    public default void configure(Map<String, String> config, PluginContext ctx) {
-        configure(config);
-    }
 }
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/PluginContext.java	Sat May 14 09:11:07 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.plugin;
-
-import java.util.Properties;
-
-/**
- * Interface to plugin (container) context.
- */
-public interface PluginContext {
-    /**
-     * Returns 'release' properties
-     */
-    public Properties getReleaseProperties();
-}
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Pool.java	Sat May 14 09:11:07 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,528 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.plugin;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UncheckedIOException;
-import java.lang.module.ModuleDescriptor;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import jdk.tools.jlink.internal.ImageFileCreator;
-import jdk.tools.jlink.internal.plugins.FileCopierPlugin;
-
-/**
- * Pool of module data.
- *
- */
-public abstract class Pool {
-
-    /**
-     * Interface to visit the content of a Pool.
-     */
-    public interface Visitor {
-
-        /**
-         * Called for each visited ModuleData.
-         *
-         * @param content A ModuleData
-         * @return A ModuleData instance or null if the passed ModuleData is to
-         * be removed from the image.
-         * @throws PluginException
-         */
-        public ModuleData visit(ModuleData content);
-    }
-
-    /**
-     * Type of module data.
-     * <li>
-     * <ul>CLASS_OR_RESOURCE: A java class or resource file.</ul>
-     * <ul>CONFIG: A configuration file.</ul>
-     * <ul>NATIVE_CMD: A native process launcher.</ul>
-     * <ul>NATIVE_LIB: A native library.</ul>
-     * <ul>OTHER: Other kind of file.</ul>
-     * </li>
-     */
-    public static enum ModuleDataType {
-
-        CLASS_OR_RESOURCE,
-        CONFIG,
-        NATIVE_CMD,
-        NATIVE_LIB,
-        OTHER;
-    }
-
-    /**
-     * A module in the pool.
-     */
-    public interface Module {
-
-        /**
-         * The module name.
-         *
-         * @return The name.
-         */
-        public String getName();
-
-        /**
-         * Retrieves a ModuleData from a path (e.g:
-         * /mymodule/com.foo.bar/MyClass.class)
-         *
-         * @param path The piece of data path.
-         * @return A ModuleData or null if the path doesn't identify a
-         * ModuleData.
-         */
-        public ModuleData get(String path);
-
-        /**
-         * The module descriptor of this module.
-         *
-         * @return The module descriptor.
-         */
-        public ModuleDescriptor getDescriptor();
-
-        /**
-         * Add a ModuleData to this module.
-         *
-         * @param data The ModuleData to add.
-         */
-        public void add(ModuleData data);
-
-        /**
-         * Retrieves all the packages located in this module.
-         *
-         * @return The set of packages.
-         */
-        public Set<String> getAllPackages();
-
-        /**
-         * Retrieves the collection of ModuleData.
-         *
-         * @return The ModuleData collection.
-         */
-        public Collection<ModuleData> getContent();
-
-    }
-
-    private class ModuleImpl implements Module {
-
-        private final Map<String, ModuleData> moduleContent = new LinkedHashMap<>();
-        private ModuleDescriptor descriptor;
-        private final String name;
-
-        private ModuleImpl(String name) {
-            this.name = name;
-        }
-
-        @Override
-        public String getName() {
-            return name;
-        }
-
-        @Override
-        public ModuleData get(String path) {
-            if (!path.startsWith("/")) {
-                path = "/" + path;
-            }
-            if (!path.startsWith("/" + name)) {
-                path = "/" + name + path;
-            }
-            return moduleContent.get(path);
-        }
-
-        @Override
-        public ModuleDescriptor getDescriptor() {
-            if (descriptor == null) {
-                String p = "/" + name + "/module-info.class";
-                ModuleData content = moduleContent.get(p);
-                if (content == null) {
-                    throw new PluginException("No module-info for " + name
-                            + " module");
-                }
-                ByteBuffer bb = ByteBuffer.wrap(content.getBytes());
-                descriptor = ModuleDescriptor.read(bb);
-            }
-            return descriptor;
-        }
-
-        @Override
-        public void add(ModuleData data) {
-            if (isReadOnly()) {
-                throw new PluginException("pool is readonly");
-            }
-            Objects.requireNonNull(data);
-            if (!data.getModule().equals(name)) {
-                throw new PluginException("Can't add resource " + data.getPath()
-                        + " to module " + name);
-            }
-            Pool.this.add(data);
-        }
-
-        @Override
-        public Set<String> getAllPackages() {
-            Set<String> pkgs = new HashSet<>();
-            moduleContent.values().stream().filter(m -> m.getType().
-                    equals(ModuleDataType.CLASS_OR_RESOURCE)).forEach((res) -> {
-                // Module metadata only contains packages with .class files
-                if (ImageFileCreator.isClassPackage(res.getPath())) {
-                    String[] split = ImageFileCreator.splitPath(res.getPath());
-                    String pkg = split[1];
-                    if (pkg != null && !pkg.isEmpty()) {
-                        pkgs.add(pkg);
-                    }
-                }
-            });
-            return pkgs;
-        }
-
-        @Override
-        public String toString() {
-            return getName();
-        }
-
-        @Override
-        public Collection<ModuleData> getContent() {
-            return Collections.unmodifiableCollection(moduleContent.values());
-        }
-    }
-
-    /**
-     * A ModuleData is the elementary unit of data inside an image. It is
-     * generally a file. e.g.: a java class file, a resource file, a shared
-     * library, ...
-     * <br>
-     * A ModuleData is identified by a path of the form:
-     * <ul>
-     * <li>For jimage content: /{module name}/{package1}/.../{packageN}/{file
-     * name}</li>
-     * <li>For other files (shared lib, launchers, config, ...):/{module name}/
-     * {@literal bin|conf|native}/{dir1}/.../{dirN}/{file name}</li>
-     * </ul>
-     */
-    public static class ModuleData {
-
-        private final ModuleDataType type;
-        private final String path;
-        private final String module;
-        private final long length;
-        private final InputStream stream;
-        private byte[] buffer;
-
-        /**
-         * Create a new ModuleData.
-         *
-         * @param module The module name.
-         * @param path The data path identifier.
-         * @param type The data type.
-         * @param stream The data content stream.
-         * @param length The stream length.
-         */
-        public ModuleData(String module, String path, ModuleDataType type,
-                InputStream stream, long length) {
-            Objects.requireNonNull(module);
-            Objects.requireNonNull(path);
-            Objects.requireNonNull(type);
-            Objects.requireNonNull(stream);
-            this.path = path;
-            this.type = type;
-            this.module = module;
-            this.stream = stream;
-            this.length = length;
-        }
-
-        /**
-         * The ModuleData module name.
-         *
-         * @return The module name.
-         */
-        public final String getModule() {
-            return module;
-        }
-
-        /**
-         * The ModuleData path.
-         *
-         * @return The module path.
-         */
-        public final String getPath() {
-            return path;
-        }
-
-        /**
-         * The ModuleData type.
-         *
-         * @return The data type.
-         */
-        public final ModuleDataType getType() {
-            return type;
-        }
-
-        /**
-         * The ModuleData content as an array of byte.
-         *
-         * @return An Array of bytes.
-         */
-        public byte[] getBytes() {
-            if (buffer == null) {
-                try {
-                    buffer = stream.readAllBytes();
-                } catch (IOException ex) {
-                    throw new UncheckedIOException(ex);
-                }
-            }
-            return buffer;
-        }
-
-        /**
-         * The ModuleData content length.
-         *
-         * @return The length.
-         */
-        public long getLength() {
-            return length;
-        }
-
-        /**
-         * The ModuleData stream.
-         *
-         * @return The module data stream.
-         */
-        public InputStream stream() {
-            return stream;
-        }
-
-        @Override
-        public int hashCode() {
-            int hash = 7;
-            hash = 89 * hash + Objects.hashCode(this.path);
-            return hash;
-        }
-
-        @Override
-        public boolean equals(Object other) {
-            if (!(other instanceof ModuleData)) {
-                return false;
-            }
-            ModuleData f = (ModuleData) other;
-            return f.path.equals(path);
-        }
-
-        @Override
-        public String toString() {
-            return getPath();
-        }
-    }
-
-    private final Map<String, ModuleData> resources = new LinkedHashMap<>();
-    private final Map<String, ModuleImpl> modules = new LinkedHashMap<>();
-    private final ModuleImpl fileCopierModule = new ModuleImpl(FileCopierPlugin.FAKE_MODULE);
-
-    private final ByteOrder order;
-
-    protected Pool() {
-        this(ByteOrder.nativeOrder());
-    }
-
-    protected Pool(ByteOrder order) {
-        Objects.requireNonNull(order);
-        this.order = order;
-    }
-
-    /**
-     * Read only state. No data can be added to a ReadOnly Pool.
-     *
-     * @return true if readonly false otherwise.
-     */
-    public abstract boolean isReadOnly();
-
-    /**
-     * Add a ModuleData.
-     *
-     * @param data The ModuleData to add.
-     */
-    public void add(ModuleData data) {
-        if (isReadOnly()) {
-            throw new PluginException("pool is readonly");
-        }
-        Objects.requireNonNull(data);
-        if (resources.get(data.getPath()) != null) {
-            throw new PluginException("Resource " + data.getPath()
-                    + " already present");
-        }
-        String modulename = data.getModule();
-        ModuleImpl m = modules.get(modulename);
-        // ## TODO: FileCopierPlugin should not add content to a module
-        // FAKE_MODULE is not really a module to be added in the image
-        if (FileCopierPlugin.FAKE_MODULE.equals(modulename)) {
-            m = fileCopierModule;
-        }
-        if (m == null) {
-            m = new ModuleImpl(modulename);
-            modules.put(modulename, m);
-        }
-        resources.put(data.getPath(), data);
-        m.moduleContent.put(data.getPath(), data);
-    }
-
-    /**
-     * Retrieves the module for the provided name.
-     *
-     * @param name The module name
-     * @return the module or null if the module doesn't exist.
-     */
-    public Module getModule(String name) {
-        Objects.requireNonNull(name);
-        return modules.get(name);
-    }
-
-    /**
-     * The collection of modules contained in this pool.
-     *
-     * @return The collection of modules.
-     */
-    public Collection<Module> getModules() {
-        return Collections.unmodifiableCollection(modules.values());
-    }
-
-    /**
-     * Get all ModuleData contained in this pool instance.
-     *
-     * @return The collection of resources;
-     */
-    public Collection<ModuleData> getContent() {
-        return Collections.unmodifiableCollection(resources.values());
-    }
-
-    /**
-     * Get the ModuleData for the passed path.
-     *
-     * @param path A data path
-     * @return A ModuleData instance or null if the data is not found
-     */
-    public ModuleData get(String path) {
-        Objects.requireNonNull(path);
-        return resources.get(path);
-    }
-
-    /**
-     * Check if the pool contains this data.
-     *
-     * @param data The module data to check existence for.
-     * @return The module data or null if not found.
-     */
-    public boolean contains(ModuleData data) {
-        Objects.requireNonNull(data);
-        return get(data.getPath()) != null;
-    }
-
-    /**
-     * Check if the Pool contains some content.
-     *
-     * @return True, no content, false otherwise.
-     */
-    public boolean isEmpty() {
-        return resources.isEmpty();
-    }
-
-    /**
-     * Visit the pool.
-     *
-     * @param visitor The Visitor called for each ModuleData found in the pool.
-     * @param output The pool to be filled with Visitor returned ModuleData.
-     */
-    public void visit(Visitor visitor, Pool output) {
-        for (ModuleData resource : getContent()) {
-            ModuleData res = visitor.visit(resource);
-            if (res != null) {
-                output.add(res);
-            }
-        }
-    }
-
-    /**
-     * The ByteOrder currently in use when generating the jimage file.
-     *
-     * @return The ByteOrder.
-     */
-    public ByteOrder getByteOrder() {
-        return order;
-    }
-
-    /**
-     * Create a ModuleData located inside a jimage file. Such ModuleData has a
-     * ModuleDataType being equals to CLASS_OR_RESOURCE.
-     *
-     * @param path The complete resource path (contains the module radical).
-     * @param content The resource content.
-     * @param size The content size.
-     * @return A new ModuleData.
-     */
-    public static ModuleData newResource(String path, InputStream content, long size) {
-        Objects.requireNonNull(path);
-        Objects.requireNonNull(content);
-        String[] split = ImageFileCreator.splitPath(path);
-        String module = split[0];
-        return new ModuleData(module, path, ModuleDataType.CLASS_OR_RESOURCE, content, size);
-    }
-
-    /**
-     * Create a ModuleData for a file that will be located inside a jimage file.
-     *
-     * @param path The resource path.
-     * @param content The resource content.
-     * @return A new ModuleData.
-     */
-    public static ModuleData newResource(String path, byte[] content) {
-        return newResource(path, new ByteArrayInputStream(content),
-                content.length);
-    }
-
-    /**
-     * Create a ModuleData for a file that will be located outside a jimage
-     * file.
-     *
-     * @param module The module in which this files is located.
-     * @param path The file path locator (doesn't contain the module name).
-     * @param type The ModuleData type.
-     * @param content The file content.
-     * @param size The content size.
-     * @return A new ModuleData.
-     */
-    public static ModuleData newImageFile(String module, String path, ModuleDataType type,
-            InputStream content, long size) {
-        Objects.requireNonNull(path);
-        Objects.requireNonNull(content);
-        return new ModuleData(module, path, type, content, size);
-    }
-
-}
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/TransformerPlugin.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/TransformerPlugin.java	Tue May 17 05:38:15 2016 -0700
@@ -40,5 +40,5 @@
      *
      * @throws PluginException
      */
-    public void visit(Pool in, Pool out);
+    public void visit(ModulePool in, ModulePool out);
 }
--- a/src/jdk.jlink/share/classes/module-info.java	Sat May 14 09:11:07 2016 -0700
+++ b/src/jdk.jlink/share/classes/module-info.java	Tue May 17 05:38:15 2016 -0700
@@ -24,9 +24,7 @@
  */
 
 module jdk.jlink {
-    exports jdk.tools.jlink;
     exports jdk.tools.jlink.plugin;
-    exports jdk.tools.jlink.builder;
 
     requires jdk.internal.opt;
     requires jdk.jdeps;
@@ -46,5 +44,5 @@
     provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.ExcludeVMPlugin;
     provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.IncludeLocalesPlugin;
     provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.GenerateJLIClassesPlugin;
-    provides jdk.tools.jlink.plugin.PostProcessorPlugin with jdk.tools.jlink.internal.plugins.ReleaseInfoPlugin;
+    provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.ReleaseInfoPlugin;
 }
--- a/test/ProblemList.txt	Sat May 14 09:11:07 2016 -0700
+++ b/test/ProblemList.txt	Tue May 17 05:38:15 2016 -0700
@@ -228,6 +228,8 @@
 sun/security/pkcs11/KeyAgreement/TestDH.java                    8077138,8023434 windows-all
 sun/security/pkcs11/KeyAgreement/TestInterop.java               8077138,8023434 windows-all
 sun/security/pkcs11/KeyAgreement/TestShort.java                 8077138,8023434 windows-all
+sun/security/pkcs11/KeyAgreement/SupportedDHKeys.java           8154910 windows-all
+sun/security/pkcs11/KeyAgreement/UnsupportedDHKeys.java         8154910 windows-all
 sun/security/pkcs11/KeyGenerator/DESParity.java                 8077138,8023434 windows-all
 sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java          8077138,8023434 windows-all
 sun/security/pkcs11/KeyPairGenerator/TestDH2048.java            8077138,8023434 windows-all
--- a/test/java/lang/invoke/VarHandles/VarHandleBaseTest.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleBaseTest.java	Tue May 17 05:38:15 2016 -0700
@@ -212,7 +212,6 @@
     }
 
     static MethodHandle findVirtual(VarHandle vh, TestAccessMode tam, MethodType mt) {
-        mt = vh.accessModeType(tam.toAccessMode());
         MethodHandle mh;
         try {
             mh = MethodHandles.publicLookup().
@@ -222,36 +221,26 @@
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
-        return bind(vh, tam, mh, mt);
+        return bind(vh, mh, mt);
     }
 
-    static MethodHandle varHandleInvokerWithAccessModeType(VarHandle vh, TestAccessMode tam, MethodType mt) {
-        mt = vh.accessModeType(tam.toAccessMode());
+    static MethodHandle varHandleInvoker(VarHandle vh, TestAccessMode tam, MethodType mt) {
         MethodHandle mh = MethodHandles.varHandleInvoker(
                 tam.toAccessMode(),
                 mt);
 
-        return bind(vh, tam, mh, mt);
+        return bind(vh, mh, mt);
     }
 
-    static MethodHandle varHandleInvokerWithSymbolicTypeDescriptor(VarHandle vh, TestAccessMode tam, MethodType mt) {
-        MethodHandle mh = MethodHandles.varHandleInvoker(
-                tam.toAccessMode(),
-                mt);
-
-        return bind(vh, tam, mh, mt);
-    }
-
-    static MethodHandle varHandleExactInvokerWithAccessModeType(VarHandle vh, TestAccessMode tam, MethodType mt) {
-        mt = vh.accessModeType(tam.toAccessMode());
+    static MethodHandle varHandleExactInvoker(VarHandle vh, TestAccessMode tam, MethodType mt) {
         MethodHandle mh = MethodHandles.varHandleExactInvoker(
                 tam.toAccessMode(),
                 mt);
 
-        return bind(vh, tam, mh, mt);
+        return bind(vh, mh, mt);
     }
 
-    private static MethodHandle bind(VarHandle vh, TestAccessMode testAccessMode, MethodHandle mh, MethodType emt) {
+    private static MethodHandle bind(VarHandle vh, MethodHandle mh, MethodType emt) {
         assertEquals(mh.type(), emt.insertParameterTypes(0, VarHandle.class),
                      "MethodHandle type differs from access mode type");
 
@@ -269,33 +258,30 @@
     enum VarHandleToMethodHandle {
         VAR_HANDLE_TO_METHOD_HANDLE(
                 "VarHandle.toMethodHandle",
+                true,
                 VarHandleBaseTest::toMethodHandle),
         METHOD_HANDLES_LOOKUP_FIND_VIRTUAL(
                 "Lookup.findVirtual",
+                false,
                 VarHandleBaseTest::findVirtual),
-        METHOD_HANDLES_VAR_HANDLE_INVOKER_WITH_ACCESS_MODE_TYPE(
-                "MethodHandles.varHandleInvoker(accessModeType)",
-                VarHandleBaseTest::varHandleInvokerWithAccessModeType),
-        METHOD_HANDLES_VAR_HANDLE_INVOKER_WITH_SYMBOLIC_TYPE_DESCRIPTOR(
-                "MethodHandles.varHandleInvoker(symbolicTypeDescriptor)",
-                VarHandleBaseTest::varHandleInvokerWithSymbolicTypeDescriptor),
-        METHOD_HANDLES_VAR_HANDLE_EXACT_INVOKER_WITH_ACCESS_MODE_TYPE(
-                "MethodHandles.varHandleExactInvoker(accessModeType)",
-                VarHandleBaseTest::varHandleExactInvokerWithAccessModeType);
+        METHOD_HANDLES_VAR_HANDLE_INVOKER(
+                "MethodHandles.varHandleInvoker",
+                false,
+                VarHandleBaseTest::varHandleInvoker),
+        METHOD_HANDLES_VAR_HANDLE_EXACT_INVOKER(
+                "MethodHandles.varHandleExactInvoker",
+                true,
+                VarHandleBaseTest::varHandleExactInvoker);
 
         final String desc;
+        final boolean isExact;
         final TriFunction<VarHandle, TestAccessMode, MethodType, MethodHandle> f;
-        final boolean exact;
 
-        VarHandleToMethodHandle(String desc, TriFunction<VarHandle, TestAccessMode, MethodType, MethodHandle> f) {
-            this(desc, f, false);
-        }
-
-        VarHandleToMethodHandle(String desc, TriFunction<VarHandle, TestAccessMode, MethodType, MethodHandle> f,
-                                boolean exact) {
+        VarHandleToMethodHandle(String desc, boolean isExact,
+                                TriFunction<VarHandle, TestAccessMode, MethodType, MethodHandle> f) {
             this.desc = desc;
             this.f = f;
-            this.exact = exact;
+            this.isExact = isExact;
         }
 
         MethodHandle apply(VarHandle vh, TestAccessMode am, MethodType mt) {
@@ -364,6 +350,15 @@
             return amToHandle.computeIfAbsent(
                     amt, k -> f.apply(vh, am, mt));
         }
+
+        Class<? extends Throwable> getWMTEOOrOther(Class<? extends Throwable> c) {
+            return f.isExact ? WrongMethodTypeException.class : c;
+        }
+
+        void checkWMTEOrCCE(ThrowingRunnable r) {
+            checkWithThrowable(getWMTEOOrOther(ClassCastException.class), null, r);
+        }
+
     }
 
     interface AccessTestAction<T> {
--- a/test/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessBoolean
  * @run testng/othervm -Diters=20000                         VarHandleTestAccessBoolean
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestAccessBoolean
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestAccessBoolean
  */
 
 import org.testng.annotations.BeforeClass;
@@ -293,6 +294,10 @@
         });
 
         checkUOE(() -> {
+            boolean r = (boolean) vh.getAndSet(recv, true);
+        });
+
+        checkUOE(() -> {
             boolean o = (boolean) vh.getAndAdd(recv, true);
         });
 
@@ -379,6 +384,10 @@
         });
 
         checkUOE(() -> {
+            boolean r = (boolean) vh.getAndSet(true);
+        });
+
+        checkUOE(() -> {
             boolean o = (boolean) vh.getAndAdd(true);
         });
 
@@ -455,6 +464,10 @@
         });
 
         checkUOE(() -> {
+            boolean r = (boolean) vh.getAndSet(recv, true);
+        });
+
+        checkUOE(() -> {
             boolean o = (boolean) vh.getAndAdd(recv, true);
         });
 
@@ -531,6 +544,10 @@
         });
 
         checkUOE(() -> {
+            boolean r = (boolean) vh.getAndSet(true);
+        });
+
+        checkUOE(() -> {
             boolean o = (boolean) vh.getAndAdd(true);
         });
 
@@ -614,6 +631,10 @@
         });
 
         checkUOE(() -> {
+            boolean r = (boolean) vh.getAndSet(array, i, true);
+        });
+
+        checkUOE(() -> {
             boolean o = (boolean) vh.getAndAdd(array, i, true);
         });
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessByte
  * @run testng/othervm -Diters=20000                         VarHandleTestAccessByte
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestAccessByte
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestAccessByte
  */
 
 import org.testng.annotations.BeforeClass;
@@ -293,6 +294,10 @@
         });
 
         checkUOE(() -> {
+            byte r = (byte) vh.getAndSet(recv, (byte)1);
+        });
+
+        checkUOE(() -> {
             byte o = (byte) vh.getAndAdd(recv, (byte)1);
         });
 
@@ -379,6 +384,10 @@
         });
 
         checkUOE(() -> {
+            byte r = (byte) vh.getAndSet((byte)1);
+        });
+
+        checkUOE(() -> {
             byte o = (byte) vh.getAndAdd((byte)1);
         });
 
@@ -455,6 +464,10 @@
         });
 
         checkUOE(() -> {
+            byte r = (byte) vh.getAndSet(recv, (byte)1);
+        });
+
+        checkUOE(() -> {
             byte o = (byte) vh.getAndAdd(recv, (byte)1);
         });
 
@@ -531,6 +544,10 @@
         });
 
         checkUOE(() -> {
+            byte r = (byte) vh.getAndSet((byte)1);
+        });
+
+        checkUOE(() -> {
             byte o = (byte) vh.getAndAdd((byte)1);
         });
 
@@ -614,6 +631,10 @@
         });
 
         checkUOE(() -> {
+            byte r = (byte) vh.getAndSet(array, i, (byte)1);
+        });
+
+        checkUOE(() -> {
             byte o = (byte) vh.getAndAdd(array, i, (byte)1);
         });
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessChar
  * @run testng/othervm -Diters=20000                         VarHandleTestAccessChar
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestAccessChar
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestAccessChar
  */
 
 import org.testng.annotations.BeforeClass;
@@ -293,6 +294,10 @@
         });
 
         checkUOE(() -> {
+            char r = (char) vh.getAndSet(recv, 'a');
+        });
+
+        checkUOE(() -> {
             char o = (char) vh.getAndAdd(recv, 'a');
         });
 
@@ -379,6 +384,10 @@
         });
 
         checkUOE(() -> {
+            char r = (char) vh.getAndSet('a');
+        });
+
+        checkUOE(() -> {
             char o = (char) vh.getAndAdd('a');
         });
 
@@ -455,6 +464,10 @@
         });
 
         checkUOE(() -> {
+            char r = (char) vh.getAndSet(recv, 'a');
+        });
+
+        checkUOE(() -> {
             char o = (char) vh.getAndAdd(recv, 'a');
         });
 
@@ -531,6 +544,10 @@
         });
 
         checkUOE(() -> {
+            char r = (char) vh.getAndSet('a');
+        });
+
+        checkUOE(() -> {
             char o = (char) vh.getAndAdd('a');
         });
 
@@ -614,6 +631,10 @@
         });
 
         checkUOE(() -> {
+            char r = (char) vh.getAndSet(array, i, 'a');
+        });
+
+        checkUOE(() -> {
             char o = (char) vh.getAndAdd(array, i, 'a');
         });
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessDouble
  * @run testng/othervm -Diters=20000                         VarHandleTestAccessDouble
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestAccessDouble
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestAccessDouble
  */
 
 import org.testng.annotations.BeforeClass;
@@ -293,6 +294,10 @@
         });
 
         checkUOE(() -> {
+            double r = (double) vh.getAndSet(recv, 1.0d);
+        });
+
+        checkUOE(() -> {
             double o = (double) vh.getAndAdd(recv, 1.0d);
         });
 
@@ -379,6 +384,10 @@
         });
 
         checkUOE(() -> {
+            double r = (double) vh.getAndSet(1.0d);
+        });
+
+        checkUOE(() -> {
             double o = (double) vh.getAndAdd(1.0d);
         });
 
@@ -455,6 +464,10 @@
         });
 
         checkUOE(() -> {
+            double r = (double) vh.getAndSet(recv, 1.0d);
+        });
+
+        checkUOE(() -> {
             double o = (double) vh.getAndAdd(recv, 1.0d);
         });
 
@@ -531,6 +544,10 @@
         });
 
         checkUOE(() -> {
+            double r = (double) vh.getAndSet(1.0d);
+        });
+
+        checkUOE(() -> {
             double o = (double) vh.getAndAdd(1.0d);
         });
 
@@ -614,6 +631,10 @@
         });
 
         checkUOE(() -> {
+            double r = (double) vh.getAndSet(array, i, 1.0d);
+        });
+
+        checkUOE(() -> {
             double o = (double) vh.getAndAdd(array, i, 1.0d);
         });
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessFloat
  * @run testng/othervm -Diters=20000                         VarHandleTestAccessFloat
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestAccessFloat
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestAccessFloat
  */
 
 import org.testng.annotations.BeforeClass;
@@ -293,6 +294,10 @@
         });
 
         checkUOE(() -> {
+            float r = (float) vh.getAndSet(recv, 1.0f);
+        });
+
+        checkUOE(() -> {
             float o = (float) vh.getAndAdd(recv, 1.0f);
         });
 
@@ -379,6 +384,10 @@
         });
 
         checkUOE(() -> {
+            float r = (float) vh.getAndSet(1.0f);
+        });
+
+        checkUOE(() -> {
             float o = (float) vh.getAndAdd(1.0f);
         });
 
@@ -455,6 +464,10 @@
         });
 
         checkUOE(() -> {
+            float r = (float) vh.getAndSet(recv, 1.0f);
+        });
+
+        checkUOE(() -> {
             float o = (float) vh.getAndAdd(recv, 1.0f);
         });
 
@@ -531,6 +544,10 @@
         });
 
         checkUOE(() -> {
+            float r = (float) vh.getAndSet(1.0f);
+        });
+
+        checkUOE(() -> {
             float o = (float) vh.getAndAdd(1.0f);
         });
 
@@ -614,6 +631,10 @@
         });
 
         checkUOE(() -> {
+            float r = (float) vh.getAndSet(array, i, 1.0f);
+        });
+
+        checkUOE(() -> {
             float o = (float) vh.getAndAdd(array, i, 1.0f);
         });
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessInt
  * @run testng/othervm -Diters=20000                         VarHandleTestAccessInt
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestAccessInt
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestAccessInt
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessLong
  * @run testng/othervm -Diters=20000                         VarHandleTestAccessLong
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestAccessLong
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestAccessLong
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessShort
  * @run testng/othervm -Diters=20000                         VarHandleTestAccessShort
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestAccessShort
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestAccessShort
  */
 
 import org.testng.annotations.BeforeClass;
@@ -293,6 +294,10 @@
         });
 
         checkUOE(() -> {
+            short r = (short) vh.getAndSet(recv, (short)1);
+        });
+
+        checkUOE(() -> {
             short o = (short) vh.getAndAdd(recv, (short)1);
         });
 
@@ -379,6 +384,10 @@
         });
 
         checkUOE(() -> {
+            short r = (short) vh.getAndSet((short)1);
+        });
+
+        checkUOE(() -> {
             short o = (short) vh.getAndAdd((short)1);
         });
 
@@ -455,6 +464,10 @@
         });
 
         checkUOE(() -> {
+            short r = (short) vh.getAndSet(recv, (short)1);
+        });
+
+        checkUOE(() -> {
             short o = (short) vh.getAndAdd(recv, (short)1);
         });
 
@@ -531,6 +544,10 @@
         });
 
         checkUOE(() -> {
+            short r = (short) vh.getAndSet((short)1);
+        });
+
+        checkUOE(() -> {
             short o = (short) vh.getAndAdd((short)1);
         });
 
@@ -614,6 +631,10 @@
         });
 
         checkUOE(() -> {
+            short r = (short) vh.getAndSet(array, i, (short)1);
+        });
+
+        checkUOE(() -> {
             short o = (short) vh.getAndAdd(array, i, (short)1);
         });
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestAccessString.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestAccessString.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessString
  * @run testng/othervm -Diters=20000                         VarHandleTestAccessString
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestAccessString
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestAccessString
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsChar
  * @run testng/othervm -Diters=20000                         VarHandleTestByteArrayAsChar
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestByteArrayAsChar
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestByteArrayAsChar
  */
 
 import org.testng.annotations.DataProvider;
@@ -254,6 +255,10 @@
                 vh.setOpaque(array, ci, VALUE_1);
             });
             checkUOE(() -> {
+                boolean r = vh.compareAndSet(array, ci, VALUE_1, VALUE_2);
+            });
+
+            checkUOE(() -> {
                 char r = (char) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
             });
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsDouble
  * @run testng/othervm -Diters=20000                         VarHandleTestByteArrayAsDouble
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestByteArrayAsDouble
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestByteArrayAsDouble
  */
 
 import org.testng.annotations.DataProvider;
@@ -254,9 +255,7 @@
             checkROBE(() -> {
                 double o = (double) vh.getAndSet(array, ci, VALUE_1);
             });
-            checkUOE(() -> {
-                boolean r = vh.compareAndSet(array, ci, VALUE_1, VALUE_2);
-            });
+
 
             checkUOE(() -> {
                 double o = (double) vh.getAndAdd(array, ci, VALUE_1);
--- a/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsFloat
  * @run testng/othervm -Diters=20000                         VarHandleTestByteArrayAsFloat
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestByteArrayAsFloat
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestByteArrayAsFloat
  */
 
 import org.testng.annotations.DataProvider;
@@ -254,9 +255,7 @@
             checkROBE(() -> {
                 float o = (float) vh.getAndSet(array, ci, VALUE_1);
             });
-            checkUOE(() -> {
-                boolean r = vh.compareAndSet(array, ci, VALUE_1, VALUE_2);
-            });
+
 
             checkUOE(() -> {
                 float o = (float) vh.getAndAdd(array, ci, VALUE_1);
--- a/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsInt
  * @run testng/othervm -Diters=20000                         VarHandleTestByteArrayAsInt
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestByteArrayAsInt
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestByteArrayAsInt
  */
 
 import org.testng.annotations.DataProvider;
@@ -247,9 +248,7 @@
             checkROBE(() -> {
                 int o = (int) vh.getAndSet(array, ci, VALUE_1);
             });
-            checkUOE(() -> {
-                boolean r = vh.compareAndSet(array, ci, VALUE_1, VALUE_2);
-            });
+
 
             checkROBE(() -> {
                 int o = (int) vh.getAndAdd(array, ci, VALUE_1);
--- a/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsLong
  * @run testng/othervm -Diters=20000                         VarHandleTestByteArrayAsLong
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestByteArrayAsLong
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestByteArrayAsLong
  */
 
 import org.testng.annotations.DataProvider;
@@ -247,9 +248,7 @@
             checkROBE(() -> {
                 long o = (long) vh.getAndSet(array, ci, VALUE_1);
             });
-            checkUOE(() -> {
-                boolean r = vh.compareAndSet(array, ci, VALUE_1, VALUE_2);
-            });
+
 
             checkROBE(() -> {
                 long o = (long) vh.getAndAdd(array, ci, VALUE_1);
--- a/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsShort.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsShort.java	Tue May 17 05:38:15 2016 -0700
@@ -27,6 +27,7 @@
  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsShort
  * @run testng/othervm -Diters=20000                         VarHandleTestByteArrayAsShort
  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestByteArrayAsShort
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestByteArrayAsShort
  */
 
 import org.testng.annotations.DataProvider;
@@ -254,6 +255,10 @@
                 vh.setOpaque(array, ci, VALUE_1);
             });
             checkUOE(() -> {
+                boolean r = vh.compareAndSet(array, ci, VALUE_1, VALUE_2);
+            });
+
+            checkUOE(() -> {
                 short r = (short) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
             });
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java	Tue May 17 05:38:15 2016 -0700
@@ -24,6 +24,7 @@
 /*
  * @test
  * @run testng/othervm -Diters=20000 VarHandleTestMethodHandleAccessBoolean
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodHandleAccessBoolean
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java	Tue May 17 05:38:15 2016 -0700
@@ -24,6 +24,7 @@
 /*
  * @test
  * @run testng/othervm -Diters=20000 VarHandleTestMethodHandleAccessByte
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodHandleAccessByte
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java	Tue May 17 05:38:15 2016 -0700
@@ -24,6 +24,7 @@
 /*
  * @test
  * @run testng/othervm -Diters=20000 VarHandleTestMethodHandleAccessChar
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodHandleAccessChar
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessDouble.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessDouble.java	Tue May 17 05:38:15 2016 -0700
@@ -24,6 +24,7 @@
 /*
  * @test
  * @run testng/othervm -Diters=20000 VarHandleTestMethodHandleAccessDouble
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodHandleAccessDouble
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessFloat.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessFloat.java	Tue May 17 05:38:15 2016 -0700
@@ -24,6 +24,7 @@
 /*
  * @test
  * @run testng/othervm -Diters=20000 VarHandleTestMethodHandleAccessFloat
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodHandleAccessFloat
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java	Tue May 17 05:38:15 2016 -0700
@@ -24,6 +24,7 @@
 /*
  * @test
  * @run testng/othervm -Diters=20000 VarHandleTestMethodHandleAccessInt
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodHandleAccessInt
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java	Tue May 17 05:38:15 2016 -0700
@@ -24,6 +24,7 @@
 /*
  * @test
  * @run testng/othervm -Diters=20000 VarHandleTestMethodHandleAccessLong
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodHandleAccessLong
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java	Tue May 17 05:38:15 2016 -0700
@@ -24,6 +24,7 @@
 /*
  * @test
  * @run testng/othervm -Diters=20000 VarHandleTestMethodHandleAccessShort
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodHandleAccessShort
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java	Tue May 17 05:38:15 2016 -0700
@@ -24,6 +24,7 @@
 /*
  * @test
  * @run testng/othervm -Diters=20000 VarHandleTestMethodHandleAccessString
+ * @run testng/othervm -Diters=20000 -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodHandleAccessString
  */
 
 import org.testng.annotations.BeforeClass;
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeBoolean.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeBoolean.java	Tue May 17 05:38:15 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8156486
  * @run testng/othervm VarHandleTestMethodTypeBoolean
  * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodTypeBoolean
  */
@@ -81,27 +82,28 @@
     public Object[][] accessTestCaseProvider() throws Exception {
         List<AccessTestCase<?>> cases = new ArrayList<>();
 
-        cases.add(new VarHandleAccessTestCase("Instance field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Instance field",
                                               vhField, vh -> testInstanceFieldWrongMethodType(this, vh),
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Static field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Static field",
                                               vhStaticField, VarHandleTestMethodTypeBoolean::testStaticFieldWrongMethodType,
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Array wrong method type",
+        cases.add(new VarHandleAccessTestCase("Array",
                                               vhArray, VarHandleTestMethodTypeBoolean::testArrayWrongMethodType,
                                               false));
+
         for (VarHandleToMethodHandle f : VarHandleToMethodHandle.values()) {
-            cases.add(new MethodHandleAccessTestCase("Instance field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Instance field",
                                                      vhField, f, hs -> testInstanceFieldWrongMethodType(this, hs),
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Static field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Static field",
                                                      vhStaticField, f, VarHandleTestMethodTypeBoolean::testStaticFieldWrongMethodType,
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Array wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Array",
                                                      vhArray, f, VarHandleTestMethodTypeBoolean::testArrayWrongMethodType,
                                                      false));
         }
@@ -329,63 +331,63 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                boolean x = (boolean) hs.get(am, methodType(boolean.class, Void.class)).
-                    invoke(null);
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class)).
+                    invokeExact((VarHandleTestMethodTypeBoolean) null);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class)).
-                    invoke(0);
+                    invokeExact(0);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
-                Void x = (Void) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class)).
-                    invoke(recv);
+                Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeBoolean.class)).
+                    invokeExact(recv);
             });
             checkWMTE(() -> { // primitive class
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeBoolean.class)).
-                    invoke(recv);
+                    invokeExact(recv);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 boolean x = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                hs.get(am, methodType(void.class, Void.class, boolean.class)).
-                    invoke(null, true);
+                hs.get(am, methodType(void.class, VarHandleTestMethodTypeBoolean.class, boolean.class)).
+                    invokeExact((VarHandleTestMethodTypeBoolean) null, true);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, boolean.class)).
-                    invoke(Void.class, true);
+                    invokeExact(Void.class, true);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeBoolean.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, boolean.class)).
-                    invoke(0, true);
+                    invokeExact(0, true);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeBoolean.class, boolean.class, Class.class)).
-                    invoke(recv, true, Void.class);
+                    invokeExact(recv, true, Void.class);
             });
         }
 
@@ -513,32 +515,32 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // primitive class
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             // Incorrect arity
             checkWMTE(() -> { // >
                 boolean x = (boolean) hs.get(am, methodType(Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, boolean.class, Class.class)).
-                    invoke(true, Void.class);
+                    invokeExact(true, Void.class);
             });
         }
 
@@ -783,71 +785,71 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                boolean x = (boolean) hs.get(am, methodType(boolean.class, Void.class, int.class)).
-                    invoke(null, 0);
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class)).
+                    invokeExact((boolean[]) null, 0);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class)).
-                    invoke(Void.class, 0);
+                    invokeExact(Void.class, 0);
             });
             checkWMTE(() -> { // array primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class)).
-                    invoke(0, 0);
+                    invokeExact(0, 0);
             });
             checkWMTE(() -> { // index reference class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, Class.class)).
-                    invoke(array, Void.class);
+                    invokeExact(array, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class, boolean[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             checkWMTE(() -> { // primitive class
                 int x = (int) hs.get(am, methodType(int.class, boolean[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 boolean x = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                hs.get(am, methodType(void.class, Void.class, int.class, boolean.class)).
-                    invoke(null, 0, true);
+                hs.get(am, methodType(void.class, boolean[].class, int.class, boolean.class)).
+                    invokeExact((boolean[]) null, 0, true);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, boolean.class)).
-                    invoke(Void.class, 0, true);
+                    invokeExact(Void.class, 0, true);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, boolean[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, boolean.class)).
-                    invoke(0, 0, true);
+                    invokeExact(0, 0, true);
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, boolean[].class, Class.class, boolean.class)).
-                    invoke(array, Void.class, true);
+                    invokeExact(array, Void.class, true);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, boolean[].class, int.class, Class.class)).
-                    invoke(array, 0, true, Void.class);
+                    invokeExact(array, 0, true, Void.class);
             });
         }
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeByte.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeByte.java	Tue May 17 05:38:15 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8156486
  * @run testng/othervm VarHandleTestMethodTypeByte
  * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodTypeByte
  */
@@ -81,27 +82,28 @@
     public Object[][] accessTestCaseProvider() throws Exception {
         List<AccessTestCase<?>> cases = new ArrayList<>();
 
-        cases.add(new VarHandleAccessTestCase("Instance field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Instance field",
                                               vhField, vh -> testInstanceFieldWrongMethodType(this, vh),
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Static field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Static field",
                                               vhStaticField, VarHandleTestMethodTypeByte::testStaticFieldWrongMethodType,
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Array wrong method type",
+        cases.add(new VarHandleAccessTestCase("Array",
                                               vhArray, VarHandleTestMethodTypeByte::testArrayWrongMethodType,
                                               false));
+
         for (VarHandleToMethodHandle f : VarHandleToMethodHandle.values()) {
-            cases.add(new MethodHandleAccessTestCase("Instance field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Instance field",
                                                      vhField, f, hs -> testInstanceFieldWrongMethodType(this, hs),
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Static field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Static field",
                                                      vhStaticField, f, VarHandleTestMethodTypeByte::testStaticFieldWrongMethodType,
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Array wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Array",
                                                      vhArray, f, VarHandleTestMethodTypeByte::testArrayWrongMethodType,
                                                      false));
         }
@@ -329,63 +331,63 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                byte x = (byte) hs.get(am, methodType(byte.class, Void.class)).
-                    invoke(null);
+                byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class)).
+                    invokeExact((VarHandleTestMethodTypeByte) null);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 byte x = (byte) hs.get(am, methodType(byte.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 byte x = (byte) hs.get(am, methodType(byte.class, int.class)).
-                    invoke(0);
+                    invokeExact(0);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
-                Void x = (Void) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class)).
-                    invoke(recv);
+                Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeByte.class)).
+                    invokeExact(recv);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeByte.class)).
-                    invoke(recv);
+                    invokeExact(recv);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 byte x = (byte) hs.get(am, methodType(byte.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                hs.get(am, methodType(void.class, Void.class, byte.class)).
-                    invoke(null, (byte)1);
+                hs.get(am, methodType(void.class, VarHandleTestMethodTypeByte.class, byte.class)).
+                    invokeExact((VarHandleTestMethodTypeByte) null, (byte)1);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, byte.class)).
-                    invoke(Void.class, (byte)1);
+                    invokeExact(Void.class, (byte)1);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeByte.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, byte.class)).
-                    invoke(0, (byte)1);
+                    invokeExact(0, (byte)1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeByte.class, byte.class, Class.class)).
-                    invoke(recv, (byte)1, Void.class);
+                    invokeExact(recv, (byte)1, Void.class);
             });
         }
 
@@ -513,32 +515,32 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             // Incorrect arity
             checkWMTE(() -> { // >
                 byte x = (byte) hs.get(am, methodType(Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, byte.class, Class.class)).
-                    invoke((byte)1, Void.class);
+                    invokeExact((byte)1, Void.class);
             });
         }
 
@@ -783,71 +785,71 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                byte x = (byte) hs.get(am, methodType(byte.class, Void.class, int.class)).
-                    invoke(null, 0);
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class)).
+                    invokeExact((byte[]) null, 0);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 byte x = (byte) hs.get(am, methodType(byte.class, Class.class, int.class)).
-                    invoke(Void.class, 0);
+                    invokeExact(Void.class, 0);
             });
             checkWMTE(() -> { // array primitive class
                 byte x = (byte) hs.get(am, methodType(byte.class, int.class, int.class)).
-                    invoke(0, 0);
+                    invokeExact(0, 0);
             });
             checkWMTE(() -> { // index reference class
                 byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, Class.class)).
-                    invoke(array, Void.class);
+                    invokeExact(array, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class, byte[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, byte[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 byte x = (byte) hs.get(am, methodType(byte.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                hs.get(am, methodType(void.class, Void.class, int.class, byte.class)).
-                    invoke(null, 0, (byte)1);
+                hs.get(am, methodType(void.class, byte[].class, int.class, byte.class)).
+                    invokeExact((byte[]) null, 0, (byte)1);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, byte.class)).
-                    invoke(Void.class, 0, (byte)1);
+                    invokeExact(Void.class, 0, (byte)1);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, byte[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, byte.class)).
-                    invoke(0, 0, (byte)1);
+                    invokeExact(0, 0, (byte)1);
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, byte[].class, Class.class, byte.class)).
-                    invoke(array, Void.class, (byte)1);
+                    invokeExact(array, Void.class, (byte)1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, byte[].class, int.class, Class.class)).
-                    invoke(array, 0, (byte)1, Void.class);
+                    invokeExact(array, 0, (byte)1, Void.class);
             });
         }
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeChar.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeChar.java	Tue May 17 05:38:15 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8156486
  * @run testng/othervm VarHandleTestMethodTypeChar
  * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodTypeChar
  */
@@ -81,27 +82,28 @@
     public Object[][] accessTestCaseProvider() throws Exception {
         List<AccessTestCase<?>> cases = new ArrayList<>();
 
-        cases.add(new VarHandleAccessTestCase("Instance field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Instance field",
                                               vhField, vh -> testInstanceFieldWrongMethodType(this, vh),
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Static field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Static field",
                                               vhStaticField, VarHandleTestMethodTypeChar::testStaticFieldWrongMethodType,
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Array wrong method type",
+        cases.add(new VarHandleAccessTestCase("Array",
                                               vhArray, VarHandleTestMethodTypeChar::testArrayWrongMethodType,
                                               false));
+
         for (VarHandleToMethodHandle f : VarHandleToMethodHandle.values()) {
-            cases.add(new MethodHandleAccessTestCase("Instance field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Instance field",
                                                      vhField, f, hs -> testInstanceFieldWrongMethodType(this, hs),
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Static field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Static field",
                                                      vhStaticField, f, VarHandleTestMethodTypeChar::testStaticFieldWrongMethodType,
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Array wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Array",
                                                      vhArray, f, VarHandleTestMethodTypeChar::testArrayWrongMethodType,
                                                      false));
         }
@@ -329,63 +331,63 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                char x = (char) hs.get(am, methodType(char.class, Void.class)).
-                    invoke(null);
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class)).
+                    invokeExact((VarHandleTestMethodTypeChar) null);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 char x = (char) hs.get(am, methodType(char.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 char x = (char) hs.get(am, methodType(char.class, int.class)).
-                    invoke(0);
+                    invokeExact(0);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
-                Void x = (Void) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class)).
-                    invoke(recv);
+                Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeChar.class)).
+                    invokeExact(recv);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class)).
-                    invoke(recv);
+                    invokeExact(recv);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 char x = (char) hs.get(am, methodType(char.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                hs.get(am, methodType(void.class, Void.class, char.class)).
-                    invoke(null, 'a');
+                hs.get(am, methodType(void.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invokeExact((VarHandleTestMethodTypeChar) null, 'a');
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, char.class)).
-                    invoke(Void.class, 'a');
+                    invokeExact(Void.class, 'a');
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeChar.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, char.class)).
-                    invoke(0, 'a');
+                    invokeExact(0, 'a');
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeChar.class, char.class, Class.class)).
-                    invoke(recv, 'a', Void.class);
+                    invokeExact(recv, 'a', Void.class);
             });
         }
 
@@ -513,32 +515,32 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             // Incorrect arity
             checkWMTE(() -> { // >
                 char x = (char) hs.get(am, methodType(Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, char.class, Class.class)).
-                    invoke('a', Void.class);
+                    invokeExact('a', Void.class);
             });
         }
 
@@ -783,71 +785,71 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                char x = (char) hs.get(am, methodType(char.class, Void.class, int.class)).
-                    invoke(null, 0);
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class)).
+                    invokeExact((char[]) null, 0);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 char x = (char) hs.get(am, methodType(char.class, Class.class, int.class)).
-                    invoke(Void.class, 0);
+                    invokeExact(Void.class, 0);
             });
             checkWMTE(() -> { // array primitive class
                 char x = (char) hs.get(am, methodType(char.class, int.class, int.class)).
-                    invoke(0, 0);
+                    invokeExact(0, 0);
             });
             checkWMTE(() -> { // index reference class
                 char x = (char) hs.get(am, methodType(char.class, char[].class, Class.class)).
-                    invoke(array, Void.class);
+                    invokeExact(array, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class, char[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 char x = (char) hs.get(am, methodType(char.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                hs.get(am, methodType(void.class, Void.class, int.class, char.class)).
-                    invoke(null, 0, 'a');
+                hs.get(am, methodType(void.class, char[].class, int.class, char.class)).
+                    invokeExact((char[]) null, 0, 'a');
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, char.class)).
-                    invoke(Void.class, 0, 'a');
+                    invokeExact(Void.class, 0, 'a');
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, char[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, char.class)).
-                    invoke(0, 0, 'a');
+                    invokeExact(0, 0, 'a');
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, char[].class, Class.class, char.class)).
-                    invoke(array, Void.class, 'a');
+                    invokeExact(array, Void.class, 'a');
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, char[].class, int.class, Class.class)).
-                    invoke(array, 0, 'a', Void.class);
+                    invokeExact(array, 0, 'a', Void.class);
             });
         }
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeDouble.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeDouble.java	Tue May 17 05:38:15 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8156486
  * @run testng/othervm VarHandleTestMethodTypeDouble
  * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodTypeDouble
  */
@@ -81,27 +82,28 @@
     public Object[][] accessTestCaseProvider() throws Exception {
         List<AccessTestCase<?>> cases = new ArrayList<>();
 
-        cases.add(new VarHandleAccessTestCase("Instance field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Instance field",
                                               vhField, vh -> testInstanceFieldWrongMethodType(this, vh),
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Static field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Static field",
                                               vhStaticField, VarHandleTestMethodTypeDouble::testStaticFieldWrongMethodType,
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Array wrong method type",
+        cases.add(new VarHandleAccessTestCase("Array",
                                               vhArray, VarHandleTestMethodTypeDouble::testArrayWrongMethodType,
                                               false));
+
         for (VarHandleToMethodHandle f : VarHandleToMethodHandle.values()) {
-            cases.add(new MethodHandleAccessTestCase("Instance field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Instance field",
                                                      vhField, f, hs -> testInstanceFieldWrongMethodType(this, hs),
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Static field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Static field",
                                                      vhStaticField, f, VarHandleTestMethodTypeDouble::testStaticFieldWrongMethodType,
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Array wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Array",
                                                      vhArray, f, VarHandleTestMethodTypeDouble::testArrayWrongMethodType,
                                                      false));
         }
@@ -329,63 +331,63 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                double x = (double) hs.get(am, methodType(double.class, Void.class)).
-                    invoke(null);
+                double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class)).
+                    invokeExact((VarHandleTestMethodTypeDouble) null);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 double x = (double) hs.get(am, methodType(double.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 double x = (double) hs.get(am, methodType(double.class, int.class)).
-                    invoke(0);
+                    invokeExact(0);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
-                Void x = (Void) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class)).
-                    invoke(recv);
+                Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeDouble.class)).
+                    invokeExact(recv);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeDouble.class)).
-                    invoke(recv);
+                    invokeExact(recv);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 double x = (double) hs.get(am, methodType(double.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                hs.get(am, methodType(void.class, Void.class, double.class)).
-                    invoke(null, 1.0d);
+                hs.get(am, methodType(void.class, VarHandleTestMethodTypeDouble.class, double.class)).
+                    invokeExact((VarHandleTestMethodTypeDouble) null, 1.0d);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, double.class)).
-                    invoke(Void.class, 1.0d);
+                    invokeExact(Void.class, 1.0d);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeDouble.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, double.class)).
-                    invoke(0, 1.0d);
+                    invokeExact(0, 1.0d);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeDouble.class, double.class, Class.class)).
-                    invoke(recv, 1.0d, Void.class);
+                    invokeExact(recv, 1.0d, Void.class);
             });
         }
 
@@ -513,32 +515,32 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             // Incorrect arity
             checkWMTE(() -> { // >
                 double x = (double) hs.get(am, methodType(Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, double.class, Class.class)).
-                    invoke(1.0d, Void.class);
+                    invokeExact(1.0d, Void.class);
             });
         }
 
@@ -783,71 +785,71 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                double x = (double) hs.get(am, methodType(double.class, Void.class, int.class)).
-                    invoke(null, 0);
+                double x = (double) hs.get(am, methodType(double.class, double[].class, int.class)).
+                    invokeExact((double[]) null, 0);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 double x = (double) hs.get(am, methodType(double.class, Class.class, int.class)).
-                    invoke(Void.class, 0);
+                    invokeExact(Void.class, 0);
             });
             checkWMTE(() -> { // array primitive class
                 double x = (double) hs.get(am, methodType(double.class, int.class, int.class)).
-                    invoke(0, 0);
+                    invokeExact(0, 0);
             });
             checkWMTE(() -> { // index reference class
                 double x = (double) hs.get(am, methodType(double.class, double[].class, Class.class)).
-                    invoke(array, Void.class);
+                    invokeExact(array, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class, double[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, double[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 double x = (double) hs.get(am, methodType(double.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 double x = (double) hs.get(am, methodType(double.class, double[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                hs.get(am, methodType(void.class, Void.class, int.class, double.class)).
-                    invoke(null, 0, 1.0d);
+                hs.get(am, methodType(void.class, double[].class, int.class, double.class)).
+                    invokeExact((double[]) null, 0, 1.0d);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, double.class)).
-                    invoke(Void.class, 0, 1.0d);
+                    invokeExact(Void.class, 0, 1.0d);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, double[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, double.class)).
-                    invoke(0, 0, 1.0d);
+                    invokeExact(0, 0, 1.0d);
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, double[].class, Class.class, double.class)).
-                    invoke(array, Void.class, 1.0d);
+                    invokeExact(array, Void.class, 1.0d);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, double[].class, int.class, Class.class)).
-                    invoke(array, 0, 1.0d, Void.class);
+                    invokeExact(array, 0, 1.0d, Void.class);
             });
         }
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeFloat.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeFloat.java	Tue May 17 05:38:15 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8156486
  * @run testng/othervm VarHandleTestMethodTypeFloat
  * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodTypeFloat
  */
@@ -81,27 +82,28 @@
     public Object[][] accessTestCaseProvider() throws Exception {
         List<AccessTestCase<?>> cases = new ArrayList<>();
 
-        cases.add(new VarHandleAccessTestCase("Instance field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Instance field",
                                               vhField, vh -> testInstanceFieldWrongMethodType(this, vh),
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Static field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Static field",
                                               vhStaticField, VarHandleTestMethodTypeFloat::testStaticFieldWrongMethodType,
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Array wrong method type",
+        cases.add(new VarHandleAccessTestCase("Array",
                                               vhArray, VarHandleTestMethodTypeFloat::testArrayWrongMethodType,
                                               false));
+
         for (VarHandleToMethodHandle f : VarHandleToMethodHandle.values()) {
-            cases.add(new MethodHandleAccessTestCase("Instance field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Instance field",
                                                      vhField, f, hs -> testInstanceFieldWrongMethodType(this, hs),
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Static field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Static field",
                                                      vhStaticField, f, VarHandleTestMethodTypeFloat::testStaticFieldWrongMethodType,
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Array wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Array",
                                                      vhArray, f, VarHandleTestMethodTypeFloat::testArrayWrongMethodType,
                                                      false));
         }
@@ -329,63 +331,63 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                float x = (float) hs.get(am, methodType(float.class, Void.class)).
-                    invoke(null);
+                float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class)).
+                    invokeExact((VarHandleTestMethodTypeFloat) null);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 float x = (float) hs.get(am, methodType(float.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 float x = (float) hs.get(am, methodType(float.class, int.class)).
-                    invoke(0);
+                    invokeExact(0);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
-                Void x = (Void) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class)).
-                    invoke(recv);
+                Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeFloat.class)).
+                    invokeExact(recv);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeFloat.class)).
-                    invoke(recv);
+                    invokeExact(recv);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 float x = (float) hs.get(am, methodType(float.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                hs.get(am, methodType(void.class, Void.class, float.class)).
-                    invoke(null, 1.0f);
+                hs.get(am, methodType(void.class, VarHandleTestMethodTypeFloat.class, float.class)).
+                    invokeExact((VarHandleTestMethodTypeFloat) null, 1.0f);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, float.class)).
-                    invoke(Void.class, 1.0f);
+                    invokeExact(Void.class, 1.0f);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeFloat.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, float.class)).
-                    invoke(0, 1.0f);
+                    invokeExact(0, 1.0f);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeFloat.class, float.class, Class.class)).
-                    invoke(recv, 1.0f, Void.class);
+                    invokeExact(recv, 1.0f, Void.class);
             });
         }
 
@@ -513,32 +515,32 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             // Incorrect arity
             checkWMTE(() -> { // >
                 float x = (float) hs.get(am, methodType(Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, float.class, Class.class)).
-                    invoke(1.0f, Void.class);
+                    invokeExact(1.0f, Void.class);
             });
         }
 
@@ -783,71 +785,71 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                float x = (float) hs.get(am, methodType(float.class, Void.class, int.class)).
-                    invoke(null, 0);
+                float x = (float) hs.get(am, methodType(float.class, float[].class, int.class)).
+                    invokeExact((float[]) null, 0);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 float x = (float) hs.get(am, methodType(float.class, Class.class, int.class)).
-                    invoke(Void.class, 0);
+                    invokeExact(Void.class, 0);
             });
             checkWMTE(() -> { // array primitive class
                 float x = (float) hs.get(am, methodType(float.class, int.class, int.class)).
-                    invoke(0, 0);
+                    invokeExact(0, 0);
             });
             checkWMTE(() -> { // index reference class
                 float x = (float) hs.get(am, methodType(float.class, float[].class, Class.class)).
-                    invoke(array, Void.class);
+                    invokeExact(array, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class, float[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, float[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 float x = (float) hs.get(am, methodType(float.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 float x = (float) hs.get(am, methodType(float.class, float[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                hs.get(am, methodType(void.class, Void.class, int.class, float.class)).
-                    invoke(null, 0, 1.0f);
+                hs.get(am, methodType(void.class, float[].class, int.class, float.class)).
+                    invokeExact((float[]) null, 0, 1.0f);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, float.class)).
-                    invoke(Void.class, 0, 1.0f);
+                    invokeExact(Void.class, 0, 1.0f);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, float[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, float.class)).
-                    invoke(0, 0, 1.0f);
+                    invokeExact(0, 0, 1.0f);
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, float[].class, Class.class, float.class)).
-                    invoke(array, Void.class, 1.0f);
+                    invokeExact(array, Void.class, 1.0f);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, float[].class, int.class, Class.class)).
-                    invoke(array, 0, 1.0f, Void.class);
+                    invokeExact(array, 0, 1.0f, Void.class);
             });
         }
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeInt.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeInt.java	Tue May 17 05:38:15 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8156486
  * @run testng/othervm VarHandleTestMethodTypeInt
  * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodTypeInt
  */
@@ -81,27 +82,28 @@
     public Object[][] accessTestCaseProvider() throws Exception {
         List<AccessTestCase<?>> cases = new ArrayList<>();
 
-        cases.add(new VarHandleAccessTestCase("Instance field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Instance field",
                                               vhField, vh -> testInstanceFieldWrongMethodType(this, vh),
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Static field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Static field",
                                               vhStaticField, VarHandleTestMethodTypeInt::testStaticFieldWrongMethodType,
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Array wrong method type",
+        cases.add(new VarHandleAccessTestCase("Array",
                                               vhArray, VarHandleTestMethodTypeInt::testArrayWrongMethodType,
                                               false));
+
         for (VarHandleToMethodHandle f : VarHandleToMethodHandle.values()) {
-            cases.add(new MethodHandleAccessTestCase("Instance field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Instance field",
                                                      vhField, f, hs -> testInstanceFieldWrongMethodType(this, hs),
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Static field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Static field",
                                                      vhStaticField, f, VarHandleTestMethodTypeInt::testStaticFieldWrongMethodType,
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Array wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Array",
                                                      vhArray, f, VarHandleTestMethodTypeInt::testArrayWrongMethodType,
                                                      false));
         }
@@ -644,211 +646,211 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                int x = (int) hs.get(am, methodType(int.class, Void.class)).
-                    invoke(null);
+                int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class)).
+                    invokeExact((VarHandleTestMethodTypeInt) null);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class)).
-                    invoke(0);
+                    invokeExact(0);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
-                Void x = (Void) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class)).
-                    invoke(recv);
+                Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeInt.class)).
+                    invokeExact(recv);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class)).
-                    invoke(recv);
+                    invokeExact(recv);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                hs.get(am, methodType(void.class, Void.class, int.class)).
-                    invoke(null, 1);
+                hs.get(am, methodType(void.class, VarHandleTestMethodTypeInt.class, int.class)).
+                    invokeExact((VarHandleTestMethodTypeInt) null, 1);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, int.class)).
-                    invoke(Void.class, 1);
+                    invokeExact(Void.class, 1);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeInt.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class)).
-                    invoke(0, 1);
+                    invokeExact(0, 1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeInt.class, int.class, Class.class)).
-                    invoke(recv, 1, Void.class);
+                    invokeExact(recv, 1, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                boolean r = (boolean) hs.get(am, methodType(boolean.class, Void.class, int.class, int.class)).
-                    invoke(null, 1, 1);
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class, int.class)).
+                    invokeExact((VarHandleTestMethodTypeInt) null, 1, 1);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, int.class)).
-                    invoke(Void.class, 1, 1);
+                    invokeExact(Void.class, 1, 1);
             });
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, Class.class, int.class)).
-                    invoke(recv, Void.class, 1);
+                    invokeExact(recv, Void.class, 1);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class, Class.class)).
-                    invoke(recv, 1, Void.class);
+                    invokeExact(recv, 1, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , int.class, int.class)).
-                    invoke(0, 1, 1);
+                    invokeExact(0, 1, 1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 boolean r = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class, int.class, Class.class)).
-                    invoke(recv, 1, 1, Void.class);
+                    invokeExact(recv, 1, 1, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
             checkNPE(() -> { // null receiver
-                int x = (int) hs.get(am, methodType(int.class, Void.class, int.class, int.class)).
-                    invoke(null, 1, 1);
+                int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class, int.class)).
+                    invokeExact((VarHandleTestMethodTypeInt) null, 1, 1);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class)).
-                    invoke(Void.class, 1, 1);
+                    invokeExact(Void.class, 1, 1);
             });
             checkWMTE(() -> { // expected reference class
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, Class.class, int.class)).
-                    invoke(recv, Void.class, 1);
+                    invokeExact(recv, Void.class, 1);
             });
             checkWMTE(() -> { // actual reference class
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class, Class.class)).
-                    invoke(recv, 1, Void.class);
+                    invokeExact(recv, 1, Void.class);
             });
             checkWMTE(() -> { // reciever primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class , int.class, int.class)).
-                    invoke(0, 1, 1);
+                    invokeExact(0, 1, 1);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeInt.class , int.class, int.class)).
-                    invoke(recv, 1, 1);
+                    invokeExact(recv, 1, 1);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class , int.class, int.class)).
-                    invoke(recv, 1, 1);
+                    invokeExact(recv, 1, 1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class, int.class, Class.class)).
-                    invoke(recv, 1, 1, Void.class);
+                    invokeExact(recv, 1, 1, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
             checkNPE(() -> { // null receiver
-                int x = (int) hs.get(am, methodType(int.class, Void.class, int.class)).
-                    invoke(null, 1);
+                int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
+                    invokeExact((VarHandleTestMethodTypeInt) null, 1);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class)).
-                    invoke(Void.class, 1);
+                    invokeExact(Void.class, 1);
             });
             checkWMTE(() -> { // value reference class
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // reciever primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class)).
-                    invoke(0, 1);
+                    invokeExact(0, 1);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invoke(recv, 1);
+                    invokeExact(recv, 1);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invoke(recv, 1);
+                    invokeExact(recv, 1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invoke(recv, 1, Void.class);
+                    invokeExact(recv, 1, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
             checkNPE(() -> { // null receiver
-                int x = (int) hs.get(am, methodType(int.class, Void.class, int.class)).
-                    invoke(null, 1);
+                int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
+                    invokeExact((VarHandleTestMethodTypeInt) null, 1);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class)).
-                    invoke(Void.class, 1);
+                    invokeExact(Void.class, 1);
             });
             checkWMTE(() -> { // value reference class
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // reciever primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class)).
-                    invoke(0, 1);
+                    invokeExact(0, 1);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invoke(recv, 1);
+                    invokeExact(recv, 1);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invoke(recv, 1);
+                    invokeExact(recv, 1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invoke(recv, 1, Void.class);
+                    invokeExact(recv, 1, Void.class);
             });
         }
     }
@@ -1190,52 +1192,52 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             // Incorrect arity
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, int.class, Class.class)).
-                    invoke(1, Void.class);
+                    invokeExact(1, Void.class);
             });
         }
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
             // Incorrect argument types
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class)).
-                    invoke(Void.class, 1);
+                    invokeExact(Void.class, 1);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, Class.class)).
-                    invoke(1, Void.class);
+                    invokeExact(1, Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 boolean r = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, Class.class)).
-                    invoke(1, 1, Void.class);
+                    invokeExact(1, 1, Void.class);
             });
         }
 
@@ -1243,29 +1245,29 @@
             // Incorrect argument types
             checkWMTE(() -> { // expected reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class)).
-                    invoke(Void.class, 1);
+                    invokeExact(Void.class, 1);
             });
             checkWMTE(() -> { // actual reference class
                 int x = (int) hs.get(am, methodType(int.class, int.class, Class.class)).
-                    invoke(1, Void.class);
+                    invokeExact(1, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int.class, int.class)).
-                    invoke(1, 1);
+                    invokeExact(1, 1);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class)).
-                    invoke(1, 1);
+                    invokeExact(1, 1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class, Class.class)).
-                    invoke(1, 1, Void.class);
+                    invokeExact(1, 1, Void.class);
             });
         }
 
@@ -1273,25 +1275,25 @@
             // Incorrect argument types
             checkWMTE(() -> { // value reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int.class)).
-                    invoke(1);
+                    invokeExact(1);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class)).
-                    invoke(1);
+                    invokeExact(1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int.class, Class.class)).
-                    invoke(1, Void.class);
+                    invokeExact(1, Void.class);
             });
         }
 
@@ -1299,25 +1301,25 @@
             // Incorrect argument types
             checkWMTE(() -> { // value reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int.class)).
-                    invoke(1);
+                    invokeExact(1);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class)).
-                    invoke(1);
+                    invokeExact(1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int.class, Class.class)).
-                    invoke(1, Void.class);
+                    invokeExact(1, Void.class);
             });
         }
     }
@@ -1909,237 +1911,237 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                int x = (int) hs.get(am, methodType(int.class, Void.class, int.class)).
-                    invoke(null, 0);
+                int x = (int) hs.get(am, methodType(int.class, int[].class, int.class)).
+                    invokeExact((int[]) null, 0);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class)).
-                    invoke(Void.class, 0);
+                    invokeExact(Void.class, 0);
             });
             checkWMTE(() -> { // array primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class)).
-                    invoke(0, 0);
+                    invokeExact(0, 0);
             });
             checkWMTE(() -> { // index reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, Class.class)).
-                    invoke(array, Void.class);
+                    invokeExact(array, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class, int[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                hs.get(am, methodType(void.class, Void.class, int.class, int.class)).
-                    invoke(null, 0, 1);
+                hs.get(am, methodType(void.class, int[].class, int.class, int.class)).
+                    invokeExact((int[]) null, 0, 1);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, int.class)).
-                    invoke(Void.class, 0, 1);
+                    invokeExact(Void.class, 0, 1);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, int[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, int.class)).
-                    invoke(0, 0, 1);
+                    invokeExact(0, 0, 1);
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, int[].class, Class.class, int.class)).
-                    invoke(array, Void.class, 1);
+                    invokeExact(array, Void.class, 1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, int[].class, int.class, Class.class)).
-                    invoke(array, 0, 1, Void.class);
+                    invokeExact(array, 0, 1, Void.class);
             });
         }
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                boolean r = (boolean) hs.get(am, methodType(boolean.class, Void.class, int.class, int.class, int.class)).
-                    invoke(null, 0, 1, 1);
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class, int.class)).
+                    invokeExact((int[]) null, 0, 1, 1);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, int.class, int.class)).
-                    invoke(Void.class, 0, 1, 1);
+                    invokeExact(Void.class, 0, 1, 1);
             });
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, Class.class, int.class)).
-                    invoke(array, 0, Void.class, 1);
+                    invokeExact(array, 0, Void.class, 1);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class, Class.class)).
-                    invoke(array, 0, 1, Void.class);
+                    invokeExact(array, 0, 1, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, int.class, int.class)).
-                    invoke(0, 0, 1, 1);
+                    invokeExact(0, 0, 1, 1);
             });
             checkWMTE(() -> { // index reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, Class.class, int.class, int.class)).
-                    invoke(array, Void.class, 1, 1);
+                    invokeExact(array, Void.class, 1, 1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 boolean r = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class, int.class, Class.class)).
-                    invoke(array, 0, 1, 1, Void.class);
+                    invokeExact(array, 0, 1, 1, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                int x = (int) hs.get(am, methodType(int.class, Void.class, int.class, int.class, int.class)).
-                    invoke(null, 0, 1, 1);
+                int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, int.class)).
+                    invokeExact((int[]) null, 0, 1, 1);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class, int.class)).
-                    invoke(Void.class, 0, 1, 1);
+                    invokeExact(Void.class, 0, 1, 1);
             });
             checkWMTE(() -> { // expected reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, Class.class, int.class)).
-                    invoke(array, 0, Void.class, 1);
+                    invokeExact(array, 0, Void.class, 1);
             });
             checkWMTE(() -> { // actual reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, Class.class)).
-                    invoke(array, 0, 1, Void.class);
+                    invokeExact(array, 0, 1, Void.class);
             });
             checkWMTE(() -> { // array primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class, int.class, int.class)).
-                    invoke(0, 0, 1, 1);
+                    invokeExact(0, 0, 1, 1);
             });
             checkWMTE(() -> { // index reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, Class.class, int.class, int.class)).
-                    invoke(array, Void.class, 1, 1);
+                    invokeExact(array, Void.class, 1, 1);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int[].class, int.class, int.class, int.class)).
-                    invoke(array, 0, 1, 1);
+                    invokeExact(array, 0, 1, 1);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class, int.class)).
-                    invoke(array, 0, 1, 1);
+                    invokeExact(array, 0, 1, 1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, int.class, Class.class)).
-                    invoke(array, 0, 1, 1, Void.class);
+                    invokeExact(array, 0, 1, 1, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                int x = (int) hs.get(am, methodType(int.class, Void.class, int.class, int.class)).
-                    invoke(null, 0, 1);
+                int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class)).
+                    invokeExact((int[]) null, 0, 1);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class)).
-                    invoke(Void.class, 0, 1);
+                    invokeExact(Void.class, 0, 1);
             });
             checkWMTE(() -> { // value reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // array primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class, int.class)).
-                    invoke(0, 0, 1);
+                    invokeExact(0, 0, 1);
             });
             checkWMTE(() -> { // index reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, Class.class, int.class)).
-                    invoke(array, Void.class, 1);
+                    invokeExact(array, Void.class, 1);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int[].class, int.class, int.class)).
-                    invoke(array, 0, 1);
+                    invokeExact(array, 0, 1);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class)).
-                    invoke(array, 0, 1);
+                    invokeExact(array, 0, 1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, Class.class)).
-                    invoke(array, 0, 1, Void.class);
+                    invokeExact(array, 0, 1, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                int x = (int) hs.get(am, methodType(int.class, Void.class, int.class, int.class)).
-                    invoke(null, 0, 1);
+                int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class)).
+                    invokeExact((int[]) null, 0, 1);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class)).
-                    invoke(Void.class, 0, 1);
+                    invokeExact(Void.class, 0, 1);
             });
             checkWMTE(() -> { // value reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // array primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class, int.class)).
-                    invoke(0, 0, 1);
+                    invokeExact(0, 0, 1);
             });
             checkWMTE(() -> { // index reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, Class.class, int.class)).
-                    invoke(array, Void.class, 1);
+                    invokeExact(array, Void.class, 1);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int[].class, int.class, int.class)).
-                    invoke(array, 0, 1);
+                    invokeExact(array, 0, 1);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class)).
-                    invoke(array, 0, 1);
+                    invokeExact(array, 0, 1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 int x = (int) hs.get(am, methodType(int.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, Class.class)).
-                    invoke(array, 0, 1, Void.class);
+                    invokeExact(array, 0, 1, Void.class);
             });
         }
     }
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeLong.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeLong.java	Tue May 17 05:38:15 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8156486
  * @run testng/othervm VarHandleTestMethodTypeLong
  * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodTypeLong
  */
@@ -81,27 +82,28 @@
     public Object[][] accessTestCaseProvider() throws Exception {
         List<AccessTestCase<?>> cases = new ArrayList<>();
 
-        cases.add(new VarHandleAccessTestCase("Instance field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Instance field",
                                               vhField, vh -> testInstanceFieldWrongMethodType(this, vh),
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Static field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Static field",
                                               vhStaticField, VarHandleTestMethodTypeLong::testStaticFieldWrongMethodType,
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Array wrong method type",
+        cases.add(new VarHandleAccessTestCase("Array",
                                               vhArray, VarHandleTestMethodTypeLong::testArrayWrongMethodType,
                                               false));
+
         for (VarHandleToMethodHandle f : VarHandleToMethodHandle.values()) {
-            cases.add(new MethodHandleAccessTestCase("Instance field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Instance field",
                                                      vhField, f, hs -> testInstanceFieldWrongMethodType(this, hs),
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Static field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Static field",
                                                      vhStaticField, f, VarHandleTestMethodTypeLong::testStaticFieldWrongMethodType,
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Array wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Array",
                                                      vhArray, f, VarHandleTestMethodTypeLong::testArrayWrongMethodType,
                                                      false));
         }
@@ -644,211 +646,211 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                long x = (long) hs.get(am, methodType(long.class, Void.class)).
-                    invoke(null);
+                long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class)).
+                    invokeExact((VarHandleTestMethodTypeLong) null);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class)).
-                    invoke(0);
+                    invokeExact(0);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
-                Void x = (Void) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class)).
-                    invoke(recv);
+                Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class)).
+                    invokeExact(recv);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class)).
-                    invoke(recv);
+                    invokeExact(recv);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 long x = (long) hs.get(am, methodType(long.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                hs.get(am, methodType(void.class, Void.class, long.class)).
-                    invoke(null, 1L);
+                hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, long.class)).
+                    invokeExact((VarHandleTestMethodTypeLong) null, 1L);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, long.class)).
-                    invoke(Void.class, 1L);
+                    invokeExact(Void.class, 1L);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, long.class)).
-                    invoke(0, 1L);
+                    invokeExact(0, 1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, long.class, Class.class)).
-                    invoke(recv, 1L, Void.class);
+                    invokeExact(recv, 1L, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                boolean r = (boolean) hs.get(am, methodType(boolean.class, Void.class, long.class, long.class)).
-                    invoke(null, 1L, 1L);
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class, long.class)).
+                    invokeExact((VarHandleTestMethodTypeLong) null, 1L, 1L);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, long.class, long.class)).
-                    invoke(Void.class, 1L, 1L);
+                    invokeExact(Void.class, 1L, 1L);
             });
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, Class.class, long.class)).
-                    invoke(recv, Void.class, 1L);
+                    invokeExact(recv, Void.class, 1L);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class, Class.class)).
-                    invoke(recv, 1L, Void.class);
+                    invokeExact(recv, 1L, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , long.class, long.class)).
-                    invoke(0, 1L, 1L);
+                    invokeExact(0, 1L, 1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 boolean r = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class, long.class, Class.class)).
-                    invoke(recv, 1L, 1L, Void.class);
+                    invokeExact(recv, 1L, 1L, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
             checkNPE(() -> { // null receiver
-                long x = (long) hs.get(am, methodType(long.class, Void.class, long.class, long.class)).
-                    invoke(null, 1L, 1L);
+                long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class, long.class)).
+                    invokeExact((VarHandleTestMethodTypeLong) null, 1L, 1L);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class, long.class)).
-                    invoke(Void.class, 1L, 1L);
+                    invokeExact(Void.class, 1L, 1L);
             });
             checkWMTE(() -> { // expected reference class
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class, long.class)).
-                    invoke(recv, Void.class, 1L);
+                    invokeExact(recv, Void.class, 1L);
             });
             checkWMTE(() -> { // actual reference class
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class, Class.class)).
-                    invoke(recv, 1L, Void.class);
+                    invokeExact(recv, 1L, Void.class);
             });
             checkWMTE(() -> { // reciever primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class , long.class, long.class)).
-                    invoke(0, 1L, 1L);
+                    invokeExact(0, 1L, 1L);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class , long.class, long.class)).
-                    invoke(recv, 1L, 1L);
+                    invokeExact(recv, 1L, 1L);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class , long.class, long.class)).
-                    invoke(recv, 1L, 1L);
+                    invokeExact(recv, 1L, 1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 long x = (long) hs.get(am, methodType(long.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class, long.class, Class.class)).
-                    invoke(recv, 1L, 1L, Void.class);
+                    invokeExact(recv, 1L, 1L, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
             checkNPE(() -> { // null receiver
-                long x = (long) hs.get(am, methodType(long.class, Void.class, long.class)).
-                    invoke(null, 1L);
+                long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
+                    invokeExact((VarHandleTestMethodTypeLong) null, 1L);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class)).
-                    invoke(Void.class, 1L);
+                    invokeExact(Void.class, 1L);
             });
             checkWMTE(() -> { // value reference class
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // reciever primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class, long.class)).
-                    invoke(0, 1L);
+                    invokeExact(0, 1L);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invoke(recv, 1L);
+                    invokeExact(recv, 1L);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invoke(recv, 1L);
+                    invokeExact(recv, 1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 long x = (long) hs.get(am, methodType(long.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invoke(recv, 1L, Void.class);
+                    invokeExact(recv, 1L, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
             checkNPE(() -> { // null receiver
-                long x = (long) hs.get(am, methodType(long.class, Void.class, long.class)).
-                    invoke(null, 1L);
+                long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
+                    invokeExact((VarHandleTestMethodTypeLong) null, 1L);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class)).
-                    invoke(Void.class, 1L);
+                    invokeExact(Void.class, 1L);
             });
             checkWMTE(() -> { // value reference class
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // reciever primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class, long.class)).
-                    invoke(0, 1L);
+                    invokeExact(0, 1L);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invoke(recv, 1L);
+                    invokeExact(recv, 1L);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invoke(recv, 1L);
+                    invokeExact(recv, 1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 long x = (long) hs.get(am, methodType(long.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invoke(recv, 1L, Void.class);
+                    invokeExact(recv, 1L, Void.class);
             });
         }
     }
@@ -1190,52 +1192,52 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             // Incorrect arity
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, long.class, Class.class)).
-                    invoke(1L, Void.class);
+                    invokeExact(1L, Void.class);
             });
         }
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
             // Incorrect argument types
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, long.class)).
-                    invoke(Void.class, 1L);
+                    invokeExact(Void.class, 1L);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long.class, Class.class)).
-                    invoke(1L, Void.class);
+                    invokeExact(1L, Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 boolean r = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long.class, long.class, Class.class)).
-                    invoke(1L, 1L, Void.class);
+                    invokeExact(1L, 1L, Void.class);
             });
         }
 
@@ -1243,29 +1245,29 @@
             // Incorrect argument types
             checkWMTE(() -> { // expected reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class)).
-                    invoke(Void.class, 1L);
+                    invokeExact(Void.class, 1L);
             });
             checkWMTE(() -> { // actual reference class
                 long x = (long) hs.get(am, methodType(long.class, long.class, Class.class)).
-                    invoke(1L, Void.class);
+                    invokeExact(1L, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long.class, long.class)).
-                    invoke(1L, 1L);
+                    invokeExact(1L, 1L);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long.class, long.class)).
-                    invoke(1L, 1L);
+                    invokeExact(1L, 1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 long x = (long) hs.get(am, methodType(long.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long.class, long.class, Class.class)).
-                    invoke(1L, 1L, Void.class);
+                    invokeExact(1L, 1L, Void.class);
             });
         }
 
@@ -1273,25 +1275,25 @@
             // Incorrect argument types
             checkWMTE(() -> { // value reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long.class)).
-                    invoke(1L);
+                    invokeExact(1L);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long.class)).
-                    invoke(1L);
+                    invokeExact(1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 long x = (long) hs.get(am, methodType(long.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long.class, Class.class)).
-                    invoke(1L, Void.class);
+                    invokeExact(1L, Void.class);
             });
         }
 
@@ -1299,25 +1301,25 @@
             // Incorrect argument types
             checkWMTE(() -> { // value reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long.class)).
-                    invoke(1L);
+                    invokeExact(1L);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long.class)).
-                    invoke(1L);
+                    invokeExact(1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 long x = (long) hs.get(am, methodType(long.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long.class, Class.class)).
-                    invoke(1L, Void.class);
+                    invokeExact(1L, Void.class);
             });
         }
     }
@@ -1909,237 +1911,237 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                long x = (long) hs.get(am, methodType(long.class, Void.class, int.class)).
-                    invoke(null, 0);
+                long x = (long) hs.get(am, methodType(long.class, long[].class, int.class)).
+                    invokeExact((long[]) null, 0);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class)).
-                    invoke(Void.class, 0);
+                    invokeExact(Void.class, 0);
             });
             checkWMTE(() -> { // array primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class)).
-                    invoke(0, 0);
+                    invokeExact(0, 0);
             });
             checkWMTE(() -> { // index reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class)).
-                    invoke(array, Void.class);
+                    invokeExact(array, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class, long[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 long x = (long) hs.get(am, methodType(long.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                hs.get(am, methodType(void.class, Void.class, int.class, long.class)).
-                    invoke(null, 0, 1L);
+                hs.get(am, methodType(void.class, long[].class, int.class, long.class)).
+                    invokeExact((long[]) null, 0, 1L);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, long.class)).
-                    invoke(Void.class, 0, 1L);
+                    invokeExact(Void.class, 0, 1L);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, long[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, long.class)).
-                    invoke(0, 0, 1L);
+                    invokeExact(0, 0, 1L);
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, long[].class, Class.class, long.class)).
-                    invoke(array, Void.class, 1L);
+                    invokeExact(array, Void.class, 1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, long[].class, int.class, Class.class)).
-                    invoke(array, 0, 1L, Void.class);
+                    invokeExact(array, 0, 1L, Void.class);
             });
         }
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                boolean r = (boolean) hs.get(am, methodType(boolean.class, Void.class, int.class, long.class, long.class)).
-                    invoke(null, 0, 1L, 1L);
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, long.class)).
+                    invokeExact((long[]) null, 0, 1L, 1L);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, long.class, long.class)).
-                    invoke(Void.class, 0, 1L, 1L);
+                    invokeExact(Void.class, 0, 1L, 1L);
             });
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, Class.class, long.class)).
-                    invoke(array, 0, Void.class, 1L);
+                    invokeExact(array, 0, Void.class, 1L);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, Class.class)).
-                    invoke(array, 0, 1L, Void.class);
+                    invokeExact(array, 0, 1L, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, long.class, long.class)).
-                    invoke(0, 0, 1L, 1L);
+                    invokeExact(0, 0, 1L, 1L);
             });
             checkWMTE(() -> { // index reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, Class.class, long.class, long.class)).
-                    invoke(array, Void.class, 1L, 1L);
+                    invokeExact(array, Void.class, 1L, 1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 boolean r = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, long.class, Class.class)).
-                    invoke(array, 0, 1L, 1L, Void.class);
+                    invokeExact(array, 0, 1L, 1L, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                long x = (long) hs.get(am, methodType(long.class, Void.class, int.class, long.class, long.class)).
-                    invoke(null, 0, 1L, 1L);
+                long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, long.class)).
+                    invokeExact((long[]) null, 0, 1L, 1L);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class, long.class, long.class)).
-                    invoke(Void.class, 0, 1L, 1L);
+                    invokeExact(Void.class, 0, 1L, 1L);
             });
             checkWMTE(() -> { // expected reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class, long.class)).
-                    invoke(array, 0, Void.class, 1L);
+                    invokeExact(array, 0, Void.class, 1L);
             });
             checkWMTE(() -> { // actual reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, Class.class)).
-                    invoke(array, 0, 1L, Void.class);
+                    invokeExact(array, 0, 1L, Void.class);
             });
             checkWMTE(() -> { // array primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class, long.class, long.class)).
-                    invoke(0, 0, 1L, 1L);
+                    invokeExact(0, 0, 1L, 1L);
             });
             checkWMTE(() -> { // index reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class, long.class, long.class)).
-                    invoke(array, Void.class, 1L, 1L);
+                    invokeExact(array, Void.class, 1L, 1L);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, long.class, long.class)).
-                    invoke(array, 0, 1L, 1L);
+                    invokeExact(array, 0, 1L, 1L);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, long.class)).
-                    invoke(array, 0, 1L, 1L);
+                    invokeExact(array, 0, 1L, 1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 long x = (long) hs.get(am, methodType(long.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, long.class, Class.class)).
-                    invoke(array, 0, 1L, 1L, Void.class);
+                    invokeExact(array, 0, 1L, 1L, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                long x = (long) hs.get(am, methodType(long.class, Void.class, int.class, long.class)).
-                    invoke(null, 0, 1L);
+                long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class)).
+                    invokeExact((long[]) null, 0, 1L);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class, long.class)).
-                    invoke(Void.class, 0, 1L);
+                    invokeExact(Void.class, 0, 1L);
             });
             checkWMTE(() -> { // value reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // array primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class, long.class)).
-                    invoke(0, 0, 1L);
+                    invokeExact(0, 0, 1L);
             });
             checkWMTE(() -> { // index reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class, long.class)).
-                    invoke(array, Void.class, 1L);
+                    invokeExact(array, Void.class, 1L);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, long.class)).
-                    invoke(array, 0, 1L);
+                    invokeExact(array, 0, 1L);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class)).
-                    invoke(array, 0, 1L);
+                    invokeExact(array, 0, 1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 long x = (long) hs.get(am, methodType(long.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, Class.class)).
-                    invoke(array, 0, 1L, Void.class);
+                    invokeExact(array, 0, 1L, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                long x = (long) hs.get(am, methodType(long.class, Void.class, int.class, long.class)).
-                    invoke(null, 0, 1L);
+                long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class)).
+                    invokeExact((long[]) null, 0, 1L);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class, long.class)).
-                    invoke(Void.class, 0, 1L);
+                    invokeExact(Void.class, 0, 1L);
             });
             checkWMTE(() -> { // value reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // array primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class, long.class)).
-                    invoke(0, 0, 1L);
+                    invokeExact(0, 0, 1L);
             });
             checkWMTE(() -> { // index reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class, long.class)).
-                    invoke(array, Void.class, 1L);
+                    invokeExact(array, Void.class, 1L);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, long.class)).
-                    invoke(array, 0, 1L);
+                    invokeExact(array, 0, 1L);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class)).
-                    invoke(array, 0, 1L);
+                    invokeExact(array, 0, 1L);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 long x = (long) hs.get(am, methodType(long.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, Class.class)).
-                    invoke(array, 0, 1L, Void.class);
+                    invokeExact(array, 0, 1L, Void.class);
             });
         }
     }
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeShort.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeShort.java	Tue May 17 05:38:15 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8156486
  * @run testng/othervm VarHandleTestMethodTypeShort
  * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodTypeShort
  */
@@ -81,27 +82,28 @@
     public Object[][] accessTestCaseProvider() throws Exception {
         List<AccessTestCase<?>> cases = new ArrayList<>();
 
-        cases.add(new VarHandleAccessTestCase("Instance field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Instance field",
                                               vhField, vh -> testInstanceFieldWrongMethodType(this, vh),
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Static field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Static field",
                                               vhStaticField, VarHandleTestMethodTypeShort::testStaticFieldWrongMethodType,
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Array wrong method type",
+        cases.add(new VarHandleAccessTestCase("Array",
                                               vhArray, VarHandleTestMethodTypeShort::testArrayWrongMethodType,
                                               false));
+
         for (VarHandleToMethodHandle f : VarHandleToMethodHandle.values()) {
-            cases.add(new MethodHandleAccessTestCase("Instance field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Instance field",
                                                      vhField, f, hs -> testInstanceFieldWrongMethodType(this, hs),
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Static field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Static field",
                                                      vhStaticField, f, VarHandleTestMethodTypeShort::testStaticFieldWrongMethodType,
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Array wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Array",
                                                      vhArray, f, VarHandleTestMethodTypeShort::testArrayWrongMethodType,
                                                      false));
         }
@@ -329,63 +331,63 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                short x = (short) hs.get(am, methodType(short.class, Void.class)).
-                    invoke(null);
+                short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class)).
+                    invokeExact((VarHandleTestMethodTypeShort) null);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 short x = (short) hs.get(am, methodType(short.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 short x = (short) hs.get(am, methodType(short.class, int.class)).
-                    invoke(0);
+                    invokeExact(0);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
-                Void x = (Void) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class)).
-                    invoke(recv);
+                Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeShort.class)).
+                    invokeExact(recv);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeShort.class)).
-                    invoke(recv);
+                    invokeExact(recv);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 short x = (short) hs.get(am, methodType(short.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                hs.get(am, methodType(void.class, Void.class, short.class)).
-                    invoke(null, (short)1);
+                hs.get(am, methodType(void.class, VarHandleTestMethodTypeShort.class, short.class)).
+                    invokeExact((VarHandleTestMethodTypeShort) null, (short)1);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, short.class)).
-                    invoke(Void.class, (short)1);
+                    invokeExact(Void.class, (short)1);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeShort.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, short.class)).
-                    invoke(0, (short)1);
+                    invokeExact(0, (short)1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeShort.class, short.class, Class.class)).
-                    invoke(recv, (short)1, Void.class);
+                    invokeExact(recv, (short)1, Void.class);
             });
         }
 
@@ -513,32 +515,32 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+                    invokeExact();
             });
             // Incorrect arity
             checkWMTE(() -> { // >
                 short x = (short) hs.get(am, methodType(Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, short.class, Class.class)).
-                    invoke((short)1, Void.class);
+                    invokeExact((short)1, Void.class);
             });
         }
 
@@ -783,71 +785,71 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                short x = (short) hs.get(am, methodType(short.class, Void.class, int.class)).
-                    invoke(null, 0);
+                short x = (short) hs.get(am, methodType(short.class, short[].class, int.class)).
+                    invokeExact((short[]) null, 0);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 short x = (short) hs.get(am, methodType(short.class, Class.class, int.class)).
-                    invoke(Void.class, 0);
+                    invokeExact(Void.class, 0);
             });
             checkWMTE(() -> { // array primitive class
                 short x = (short) hs.get(am, methodType(short.class, int.class, int.class)).
-                    invoke(0, 0);
+                    invokeExact(0, 0);
             });
             checkWMTE(() -> { // index reference class
                 short x = (short) hs.get(am, methodType(short.class, short[].class, Class.class)).
-                    invoke(array, Void.class);
+                    invokeExact(array, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void x = (Void) hs.get(am, methodType(Void.class, short[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, short[].class, int.class)).
-                    invoke(array, 0);
+                    invokeExact(array, 0);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 short x = (short) hs.get(am, methodType(short.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
-                hs.get(am, methodType(void.class, Void.class, int.class, short.class)).
-                    invoke(null, 0, (short)1);
+                hs.get(am, methodType(void.class, short[].class, int.class, short.class)).
+                    invokeExact((short[]) null, 0, (short)1);
             });
-            checkCCE(() -> { // array reference class
+            hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, short.class)).
-                    invoke(Void.class, 0, (short)1);
+                    invokeExact(Void.class, 0, (short)1);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, short[].class, int.class, Class.class)).
-                    invoke(array, 0, Void.class);
+                    invokeExact(array, 0, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, short.class)).
-                    invoke(0, 0, (short)1);
+                    invokeExact(0, 0, (short)1);
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, short[].class, Class.class, short.class)).
-                    invoke(array, Void.class, (short)1);
+                    invokeExact(array, Void.class, (short)1);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, short[].class, int.class, Class.class)).
-                    invoke(array, 0, (short)1, Void.class);
+                    invokeExact(array, 0, (short)1, Void.class);
             });
         }
 
--- a/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeString.java	Sat May 14 09:11:07 2016 -0700
+++ b/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeString.java	Tue May 17 05:38:15 2016 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8156486
  * @run testng/othervm VarHandleTestMethodTypeString
  * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodTypeString
  */
@@ -81,27 +82,28 @@
     public Object[][] accessTestCaseProvider() throws Exception {
         List<AccessTestCase<?>> cases = new ArrayList<>();
 
-        cases.add(new VarHandleAccessTestCase("Instance field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Instance field",
                                               vhField, vh -> testInstanceFieldWrongMethodType(this, vh),
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Static field wrong method type",
+        cases.add(new VarHandleAccessTestCase("Static field",
                                               vhStaticField, VarHandleTestMethodTypeString::testStaticFieldWrongMethodType,
                                               false));
 
-        cases.add(new VarHandleAccessTestCase("Array wrong method type",
+        cases.add(new VarHandleAccessTestCase("Array",
                                               vhArray, VarHandleTestMethodTypeString::testArrayWrongMethodType,
                                               false));
+
         for (VarHandleToMethodHandle f : VarHandleToMethodHandle.values()) {
-            cases.add(new MethodHandleAccessTestCase("Instance field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Instance field",
                                                      vhField, f, hs -> testInstanceFieldWrongMethodType(this, hs),
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Static field wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Static field",
                                                      vhStaticField, f, VarHandleTestMethodTypeString::testStaticFieldWrongMethodType,
                                                      false));
 
-            cases.add(new MethodHandleAccessTestCase("Array wrong method type",
+            cases.add(new MethodHandleAccessTestCase("Array",
                                                      vhArray, f, VarHandleTestMethodTypeString::testArrayWrongMethodType,
                                                      false));
         }
@@ -586,174 +588,174 @@
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                String x = (String) hs.get(am, methodType(String.class, Void.class)).
-                    invoke(null);
+                String x = (String) hs.get(am, methodType(String.class, VarHandleTestMethodTypeString.class)).
+                    invokeExact((VarHandleTestMethodTypeString) null);
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 String x = (String) hs.get(am, methodType(String.class, Class.class)).
-                    invoke(Void.class);
+                    invokeExact(Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 String x = (String) hs.get(am, methodType(String.class, int.class)).
-                    invoke(0);
+                    invokeExact(0);
             });
             // Incorrect return type
-            checkCCE(() -> { // reference class
-                Void x = (Void) hs.get(am, methodType(String.class, VarHandleTestMethodTypeString.class)).
-                    invoke(recv);
+            hs.checkWMTEOrCCE(() -> { // reference class
+                Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeString.class)).
+                    invokeExact(recv);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class)).
-                    invoke(recv);
+                    invokeExact(recv);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 String x = (String) hs.get(am, methodType(String.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 String x = (String) hs.get(am, methodType(String.class, VarHandleTestMethodTypeString.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                hs.get(am, methodType(void.class, Void.class, String.class)).
-                    invoke(null, "foo");
+                hs.get(am, methodType(void.class, VarHandleTestMethodTypeString.class, String.class)).
+                    invokeExact((VarHandleTestMethodTypeString) null, "foo");
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, String.class)).
-                    invoke(Void.class, "foo");
+                    invokeExact(Void.class, "foo");
             });
-            checkCCE(() -> { // value reference class
+            hs.checkWMTEOrCCE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeString.class, Class.class)).
-                    invoke(recv, Void.class);
+                    invokeExact(recv, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, String.class)).
-                    invoke(0, "foo");
+                    invokeExact(0, "foo");
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
-                    invoke();
+                    invokeExact();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeString.class, String.class, Class.class)).
-                    invoke(recv, "foo", Void.class);
+                    invokeExact(recv, "foo", Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
-                boolean r = (boolean) hs.get(am, methodType(boolean.class, Void.class, String.class, String.class)).
-                    invoke(null, "foo", "foo");
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class, String.class, String.class)).
+                    invokeExact((VarHandleTestMethodTypeString) null, "foo", "foo");
             });
-            checkCCE(() -> { // receiver reference class
+            hs.checkWMTEOrCCE(() -> { // receiver reference class