Merge
authoramurillo
Thu, 30 Jun 2016 10:31:19 -0700
changeset 39330 6f808f6d8684
parent 39329 3c1532acb5e0 (current diff)
parent 39322 66ecf193683a (diff)
child 39331 a688c540c4ca
Merge
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/ExecutableImage.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/PostProcessorPlugin.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/TransformerPlugin.java
--- a/jdk/make/mapfiles/libjava/mapfile-vers	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/make/mapfiles/libjava/mapfile-vers	Thu Jun 30 10:31:19 2016 -0700
@@ -56,6 +56,7 @@
 		JNU_ThrowArrayIndexOutOfBoundsException;
 		JNU_ThrowByName;
 		JNU_ThrowByNameWithLastError;
+		JNU_ThrowByNameWithMessageAndLastError;
 		JNU_ThrowClassNotFoundException;
 		JNU_ThrowIllegalAccessError;
 		JNU_ThrowIllegalAccessException;
--- a/jdk/src/java.base/macosx/native/libjava/java_props_macosx.c	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/macosx/native/libjava/java_props_macosx.c	Thu Jun 30 10:31:19 2016 -0700
@@ -182,7 +182,17 @@
         // Copy out the char*
         osVersionCStr = strdup([nsVerStr UTF8String]);
     }
-
+    // Fallback if running on pre-10.9 Mac OS
+    if (osVersionCStr == NULL) {
+        NSDictionary *version = [NSDictionary dictionaryWithContentsOfFile :
+                                 @"/System/Library/CoreServices/SystemVersion.plist"];
+        if (version != NULL) {
+            NSString *nsVerStr = [version objectForKey : @"ProductVersion"];
+            if (nsVerStr != NULL) {
+                osVersionCStr = strdup([nsVerStr UTF8String]);
+            }
+        }
+    }
     if (osVersionCStr == NULL) {
         osVersionCStr = strdup("Unknown");
     }
@@ -190,7 +200,9 @@
 }
 
 
-static Boolean getProxyInfoForProtocol(CFDictionaryRef inDict, CFStringRef inEnabledKey, CFStringRef inHostKey, CFStringRef inPortKey, CFStringRef *outProxyHost, int *ioProxyPort) {
+static Boolean getProxyInfoForProtocol(CFDictionaryRef inDict, CFStringRef inEnabledKey,
+                                       CFStringRef inHostKey, CFStringRef inPortKey,
+                                       CFStringRef *outProxyHost, int *ioProxyPort) {
     /* See if the proxy is enabled. */
     CFNumberRef cf_enabled = CFDictionaryGetValue(inDict, inEnabledKey);
     if (cf_enabled == NULL) {
--- a/jdk/src/java.base/share/classes/java/text/DateFormatSymbols.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/text/DateFormatSymbols.java	Thu Jun 30 10:31:19 2016 -0700
@@ -221,7 +221,7 @@
      * </ul>
      * The zone ID is <em>not</em> localized; it's one of the valid IDs of
      * the {@link java.util.TimeZone TimeZone} class that are not
-     * <a href="../java/util/TimeZone.html#CustomID">custom IDs</a>.
+     * <a href="../util/TimeZone.html#CustomID">custom IDs</a>.
      * All other entries are localized names.
      * @see java.util.TimeZone
      * @serial
--- a/jdk/src/java.base/share/classes/javax/crypto/Cipher.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/share/classes/javax/crypto/Cipher.java	Thu Jun 30 10:31:19 2016 -0700
@@ -93,7 +93,7 @@
  * provide authenticity assurances for both confidential data and
  * Additional Associated Data (AAD) that is not encrypted.  (Please see
  * <a href="http://www.ietf.org/rfc/rfc5116.txt"> RFC 5116 </a> for more
- * information on AEAD and AEAD algorithms such as GCM/CCM.) Both
+ * information on AEAD and AAD algorithms such as GCM/CCM.) Both
  * confidential and AAD data can be used when calculating the
  * authentication tag (similar to a {@link Mac}).  This tag is appended
  * to the ciphertext during encryption, and is verified on decryption.
@@ -1186,7 +1186,7 @@
      * determined from the given key, or if the given key has a keysize that
      * exceeds the maximum allowable keysize (as determined from the
      * configured jurisdiction policy files).
-     * @throws UnsupportedOperationException if (@code opmode} is
+     * @throws UnsupportedOperationException if {@code opmode} is
      * {@code WRAP_MODE} or {@code UNWRAP_MODE} but the mode is not implemented
      * by the underlying {@code CipherSpi}.
      */
@@ -1239,7 +1239,7 @@
      * determined from the given key, or if the given key has a keysize that
      * exceeds the maximum allowable keysize (as determined from the
      * configured jurisdiction policy files).
-     * @throws UnsupportedOperationException if (@code opmode} is
+     * @throws UnsupportedOperationException if {@code opmode} is
      * {@code WRAP_MODE} or {@code UNWRAP_MODE} but the mode is not implemented
      * by the underlying {@code CipherSpi}.
      */
@@ -1325,7 +1325,7 @@
      * algorithm parameters imply a cryptographic strength that would exceed
      * the legal limits (as determined from the configured jurisdiction
      * policy files).
-     * @throws UnsupportedOperationException if (@code opmode} is
+     * @throws UnsupportedOperationException if {@code opmode} is
      * {@code WRAP_MODE} or {@code UNWRAP_MODE} but the mode is not implemented
      * by the underlying {@code CipherSpi}.
      */
@@ -1386,7 +1386,7 @@
      * algorithm parameters imply a cryptographic strength that would exceed
      * the legal limits (as determined from the configured jurisdiction
      * policy files).
-     * @throws UnsupportedOperationException if (@code opmode} is
+     * @throws UnsupportedOperationException if {@code opmode} is
      * {@code WRAP_MODE} or {@code UNWRAP_MODE} but the mode is not implemented
      * by the underlying {@code CipherSpi}.
      */
@@ -1468,7 +1468,7 @@
      * algorithm parameters imply a cryptographic strength that would exceed
      * the legal limits (as determined from the configured jurisdiction
      * policy files).
-     * @throws UnsupportedOperationException if (@code opmode} is
+     * @throws UnsupportedOperationException if {@code opmode} is
      * {@code WRAP_MODE} or {@code UNWRAP_MODE} but the mode is not implemented
      * by the underlying {@code CipherSpi}.
      */
@@ -1529,7 +1529,7 @@
      * algorithm parameters imply a cryptographic strength that would exceed
      * the legal limits (as determined from the configured jurisdiction
      * policy files).
-     * @throws UnsupportedOperationException if (@code opmode} is
+     * @throws UnsupportedOperationException if {@code opmode} is
      * {@code WRAP_MODE} or {@code UNWRAP_MODE} but the mode is not implemented
      * by the underlying {@code CipherSpi}.
      */
@@ -1616,7 +1616,7 @@
      * in the given certificate has a keysize that exceeds the maximum
      * allowable keysize (as determined by the configured jurisdiction policy
      * files).
-     * @throws UnsupportedOperationException if (@code opmode} is
+     * @throws UnsupportedOperationException if {@code opmode} is
      * {@code WRAP_MODE} or {@code UNWRAP_MODE} but the mode is not implemented
      * by the underlying {@code CipherSpi}.
      */
@@ -1686,7 +1686,7 @@
      * in the given certificate has a keysize that exceeds the maximum
      * allowable keysize (as determined by the configured jurisdiction policy
      * files).
-     * @throws UnsupportedOperationException if (@code opmode} is
+     * @throws UnsupportedOperationException if {@code opmode} is
      * {@code WRAP_MODE} or {@code UNWRAP_MODE} but the mode is not implemented
      * by the underlying {@code CipherSpi}.
      */
--- a/jdk/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java	Thu Jun 30 10:31:19 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -97,10 +97,11 @@
                 t.setDaemon(true);
                 return t;
             }
-        });
+        }, new ThreadPoolExecutor.DiscardPolicy());
         threadMgr.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
         threadMgr.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
         threadMgr.setKeepAliveTime(5000, TimeUnit.MILLISECONDS);
+        threadMgr.allowCoreThreadTimeOut(true);
         responseCache = Cache.newSoftMemoryCache(cacheCapacity, cacheLifetime);
     }
 
--- a/jdk/src/java.base/share/native/libjava/jni_util.c	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/share/native/libjava/jni_util.c	Thu Jun 30 10:31:19 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
@@ -147,9 +147,9 @@
     JNU_ThrowByName(env, "java/lang/InstantiationException", msg);
 }
 
-
-/* Throw an exception by name, using the string returned by
- * JVM_LastErrorString for the detail string.  If the last-error
+/*
+ * Throw an exception by name, using the string returned by
+ * getLastErrorString for the detail string. If the last-error
  * string is NULL, use the given default detail string.
  */
 JNIEXPORT void JNICALL
@@ -174,9 +174,64 @@
     }
 }
 
-/* Throw an IOException, using the last-error string for the detail
- * string.  If the last-error string is NULL, use the given default
- * detail string.
+/*
+ * Throw an exception by name, using a given message and the string
+ * returned by getLastErrorString to construct the detail string.
+ */
+JNIEXPORT void JNICALL
+JNU_ThrowByNameWithMessageAndLastError
+  (JNIEnv *env, const char *name, const char *message)
+{
+    char buf[256];
+    size_t n = getLastErrorString(buf, sizeof(buf));
+    size_t messagelen = message == NULL ? 0 : strlen(message);
+
+    if (n > 0) {
+        jstring s = JNU_NewStringPlatform(env, buf);
+        if (s != NULL) {
+            jobject x = NULL;
+            if (messagelen) {
+                jstring s2 = NULL;
+                size_t messageextlen = messagelen + 4;
+                char *str1 = (char *)malloc((messageextlen) * sizeof(char));
+                if (str1 == 0) {
+                    JNU_ThrowOutOfMemoryError(env, 0);
+                    return;
+                }
+                jio_snprintf(str1, messageextlen, " (%s)", message);
+                s2 = (*env)->NewStringUTF(env, str1);
+                free(str1);
+                if (s2 != NULL) {
+                    jstring s3 = JNU_CallMethodByName(
+                                     env, NULL, s, "concat",
+                                     "(Ljava/lang/String;)Ljava/lang/String;",
+                                     s2).l;
+                    (*env)->DeleteLocalRef(env, s2);
+                    if (s3 != NULL) {
+                        (*env)->DeleteLocalRef(env, s);
+                        s = s3;
+                    }
+                }
+            }
+            x = JNU_NewObjectByName(env, name, "(Ljava/lang/String;)V", s);
+            if (x != NULL) {
+                (*env)->Throw(env, x);
+            }
+        }
+    }
+
+    if (!(*env)->ExceptionOccurred(env)) {
+        if (messagelen) {
+            JNU_ThrowByName(env, name, message);
+        } else {
+            JNU_ThrowByName(env, name, "no further information");
+        }
+    }
+}
+
+/*
+ * Convenience method.
+ * Call JNU_ThrowByNameWithLastError for java.io.IOException.
  */
 JNIEXPORT void JNICALL
 JNU_ThrowIOExceptionWithLastError(JNIEnv *env, const char *defaultDetail)
--- a/jdk/src/java.base/share/native/libjava/jni_util.h	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/share/native/libjava/jni_util.h	Thu Jun 30 10:31:19 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
@@ -98,15 +98,22 @@
 JNU_ThrowInstantiationException(JNIEnv *env, const char *msg);
 
 /* Throw an exception by name, using the string returned by
- * JVM_LastErrorString for the detail string.  If the last-error
+ * getLastErrorString for the detail string. If the last-error
  * string is NULL, use the given default detail string.
  */
 JNIEXPORT void JNICALL
 JNU_ThrowByNameWithLastError(JNIEnv *env, const char *name,
-                             const char *defaultMessage);
+                             const char *defaultDetail);
+
+/* Throw an exception by name, using a given message and the string
+ * returned by getLastErrorString to construct the detail string.
+ */
+JNIEXPORT void JNICALL
+JNU_ThrowByNameWithMessageAndLastError
+  (JNIEnv *env, const char *name, const char *message);
 
 /* Throw an IOException, using the last-error string for the detail
- * string.  If the last-error string is NULL, use the given default
+ * string. If the last-error string is NULL, use the given default
  * detail string.
  */
 JNIEXPORT void JNICALL
--- a/jdk/src/java.base/unix/native/libnet/NetworkInterface.c	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/unix/native/libnet/NetworkInterface.c	Thu Jun 30 10:31:19 2016 -0700
@@ -621,8 +621,8 @@
     (*env)->ReleaseStringUTFChars(env, name, name_utf);
 
     if (ret < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGLIFFLAGS failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "getFlags() failed");
         return -1;
     }
 
@@ -1061,8 +1061,8 @@
         // If EPROTONOSUPPORT is returned it means we don't have
         // support for this proto so don't throw an exception.
         if (errno != EPROTONOSUPPORT) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                         "Socket creation failed");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Socket creation failed");
         }
         return -1;
     }
@@ -1087,13 +1087,13 @@
     if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
         if (errno == EPROTONOSUPPORT) {
             if ((sock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
-                NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                             "IPV6 Socket creation failed");
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, JNU_JAVANETPKG "SocketException", "IPV6 Socket creation failed");
                 return -1;
             }
         } else { // errno is not NOSUPPORT
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                         "IPV4 Socket creation failed");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "IPV4 Socket creation failed");
             return -1;
         }
     }
@@ -1122,15 +1122,15 @@
     // SIOCGIFCOUNT doesn't work
     ifc.ifc_buf = NULL;
     if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGIFCONF failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFCONF) failed");
         return ifs;
     }
 #elif defined(_AIX)
     ifc.ifc_buf = NULL;
     if (ioctl(sock, SIOCGSIZIFCONF, &(ifc.ifc_len)) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGSIZIFCONF failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGSIZIFCONF) failed");
         return ifs;
     }
 #endif /* __linux__ */
@@ -1142,8 +1142,8 @@
     siocgifconfRequest = CSIOCGIFCONF;
 #endif
     if (ioctl(sock, siocgifconfRequest, (char *)&ifc) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGIFCONF failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFCONF) failed");
         free(buf);
         return ifs;
     }
@@ -1268,8 +1268,8 @@
 
     ifc.ifc_buf = NULL;
     if (ioctl(sock, SIOCGSIZIFCONF, &(ifc.ifc_len)) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                    "ioctl SIOCGSIZIFCONF failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGSIZIFCONF) failed");
         return ifs;
     }
     bufsize = ifc.ifc_len;
@@ -1282,8 +1282,8 @@
     ifc.ifc_len = bufsize;
     ifc.ifc_buf = buf;
     if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl CSIOCGIFCONF failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFCONF) failed");
         free(buf);
         return ifs;
     }
@@ -1368,16 +1368,16 @@
 
     // Let's make sure the interface does have a broadcast address.
     if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2)  < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGIFFLAGS failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFFLAGS) failed");
         return ret;
     }
 
     if (if2.ifr_flags & IFF_BROADCAST) {
         // It does, let's retrieve it
         if (ioctl(sock, SIOCGIFBRDADDR, (char *)&if2) < 0) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                         "ioctl SIOCGIFBRDADDR failed");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFBRDADDR) failed");
             return ret;
         }
 
@@ -1400,8 +1400,8 @@
     strncpy(if2.ifr_name, ifname, sizeof(if2.ifr_name) - 1);
 
     if (ioctl(sock, SIOCGIFNETMASK, (char *)&if2) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGIFNETMASK failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFNETMASK) failed");
         return -1;
     }
 
@@ -1463,8 +1463,8 @@
     memset((char *)&ifr, 0, sizeof(ifr));
     strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1);
     if (ioctl(sock, SIOCGIFHWADDR, &ifr) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGIFHWADDR failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFHWADDR) failed");
         return -1;
     }
 
@@ -1493,8 +1493,8 @@
     }
 
     if (ioctl(sock, SIOCGIFMTU, (char *)&if2) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGIFMTU failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFMTU) failed");
         return -1;
     }
 
@@ -1535,15 +1535,15 @@
     if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
         if (errno == EPROTONOSUPPORT) {
             if ((sock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
-                NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                             "IPV6 Socket creation failed");
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, JNU_JAVANETPKG "SocketException", "IPV6 Socket creation failed");
                 return -1;
             }
 
             alreadyV6=1;
         } else { // errno is not NOSUPPORT
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                         "IPV4 Socket creation failed");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "IPV4 Socket creation failed");
             return -1;
         }
     }
@@ -1562,8 +1562,8 @@
         if (ioctl(sock, SIOCGLIFNETMASK, (char *)&if2) < 0) {
             close(sock);
             if ((sock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
-                NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                             "IPV6 Socket creation failed");
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, JNU_JAVANETPKG "SocketException", "IPV6 Socket creation failed");
                 return -1;
             }
         }
@@ -1607,8 +1607,8 @@
     numifs.lifn_family = family;
     numifs.lifn_flags = 0;
     if (ioctl(sock, SIOCGLIFNUM, (char *)&numifs) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGLIFNUM failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGLIFNUM) failed");
         return ifs;
     }
 
@@ -1621,8 +1621,8 @@
     ifc.lifc_len = bufsize;
     ifc.lifc_buf = buf;
     if (ioctl(sock, SIOCGLIFCONF, (char *)&ifc) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGLIFCONF failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGLIFCONF) failed");
         free(buf);
         return ifs;
     }
@@ -1689,16 +1689,16 @@
 
     // Let's make sure the interface does have a broadcast address
     if (ioctl(sock, SIOCGLIFFLAGS, (char *)&if2)  < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGLIFFLAGS failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGLIFFLAGS) failed");
         return ret;
     }
 
     if (if2.lifr_flags & IFF_BROADCAST) {
         // It does, let's retrieve it
         if (ioctl(sock, SIOCGLIFBRDADDR, (char *)&if2) < 0) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                         "ioctl SIOCGLIFBRDADDR failed");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGLIFBRDADDR) failed");
             return ret;
         }
 
@@ -1721,8 +1721,8 @@
     strncpy(if2.lifr_name, ifname, sizeof(if2.lifr_name) - 1);
 
     if (ioctl(sock, SIOCGLIFNETMASK, (char *)&if2) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGLIFNETMASK failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGLIFNETMASK) failed");
         return -1;
     }
 
@@ -1764,8 +1764,8 @@
     msg.len = DL_PHYS_ADDR_REQ_SIZE;
 
     if (putmsg(fd, &msg, NULL, 0) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "putmsg failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "putmsg() failed");
         return -1;
     }
 
@@ -1775,8 +1775,8 @@
     msg.len = 0;
     msg.maxlen = sizeof (buf);
     if (getmsg(fd, &msg, NULL, &flags) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "getmsg failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "getmsg() failed");
         return -1;
     }
 
@@ -1860,8 +1860,8 @@
     strncpy(if2.lifr_name, ifname, sizeof(if2.lifr_name) - 1);
 
     if (ioctl(sock, SIOCGLIFMTU, (char *)&if2) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                    "ioctl SIOCGLIFMTU failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGLIFMTU) failed");
         return -1;
     }
 
@@ -1900,13 +1900,13 @@
      if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
          if (errno == EPROTONOSUPPORT) {
               if ((sock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
-                 NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                              "IPV6 Socket creation failed");
+                 JNU_ThrowByNameWithMessageAndLastError
+                     (env, JNU_JAVANETPKG "SocketException", "IPV6 Socket creation failed");
                  return -1;
               }
          } else { // errno is not NOSUPPORT
-             NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                          "IPV4 Socket creation failed");
+             JNU_ThrowByNameWithMessageAndLastError
+                 (env, JNU_JAVANETPKG "SocketException", "IPV4 Socket creation failed");
              return -1;
          }
    }
@@ -1927,8 +1927,8 @@
     struct ifaddrs *ifa, *origifa;
 
     if (getifaddrs(&origifa) != 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "getifaddrs() function failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "getifaddrs() failed");
         return ifs;
     }
 
@@ -1997,8 +1997,8 @@
     struct in6_ifreq ifr6;
 
     if (getifaddrs(&origifa) != 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "getifaddrs() function failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "getifaddrs() failed");
         return ifs;
     }
 
@@ -2014,8 +2014,8 @@
                MIN(sizeof(ifr6.ifr_addr), ifa->ifa_addr->sa_len));
 
         if (ioctl(sock, SIOCGIFNETMASK_IN6, (caddr_t)&ifr6) < 0) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                         "ioctl SIOCGIFNETMASK_IN6 failed");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFNETMASK_IN6) failed");
             freeifaddrs(origifa);
             freeif(ifs);
             return NULL;
@@ -2075,16 +2075,16 @@
 
     // Make sure the interface does have a broadcast address
     if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGIFFLAGS failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFFLAGS) failed");
         return ret;
     }
 
     if (if2.ifr_flags & IFF_BROADCAST) {
         // It does, let's retrieve it
         if (ioctl(sock, SIOCGIFBRDADDR, (char *)&if2) < 0) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                         "ioctl SIOCGIFBRDADDR failed");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFBRDADDR) failed");
             return ret;
         }
 
@@ -2107,8 +2107,8 @@
     strncpy(if2.ifr_name, ifname, sizeof(if2.ifr_name) - 1);
 
     if (ioctl(sock, SIOCGIFNETMASK, (char *)&if2) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGIFNETMASK failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFNETMASK) failed");
         return -1;
     }
 
@@ -2156,8 +2156,8 @@
     strncpy(if2.ifr_name, ifname, sizeof(if2.ifr_name) - 1);
 
     if (ioctl(sock, SIOCGIFMTU, (char *)&if2) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "ioctl SIOCGIFMTU failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFMTU) failed");
         return -1;
     }
 
--- a/jdk/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c	Thu Jun 30 10:31:19 2016 -0700
@@ -221,8 +221,8 @@
             NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "BindException",
                             "Bind failed");
         } else {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                            "Bind failed");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Bind failed");
         }
         return;
     }
@@ -233,8 +233,8 @@
          * that the system chose for us and store it in the Socket object.
          */
         if (getsockname(fd, (struct sockaddr *)&him, &slen) == -1) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                            "Error getting socket name");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Error getting socket name");
             return;
         }
 
@@ -469,7 +469,7 @@
             JNU_ThrowByName(env, JNU_JAVANETPKG "PortUnreachableException",
                             "ICMP Port Unreachable");
         } else {
-            NET_ThrowByNameWithLastError(env, "java/io/IOException", "sendto failed");
+            JNU_ThrowIOExceptionWithLastError(env, "sendto failed");
         }
     }
 
@@ -520,7 +520,8 @@
             } else if (errno == ENOMEM) {
                  JNU_ThrowOutOfMemoryError(env, "NET_Timeout native heap allocation failed");
             } else {
-                 NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "Peek failed");
+                 JNU_ThrowByNameWithMessageAndLastError
+                     (env, JNU_JAVANETPKG "SocketException", "Peek failed");
             }
             return ret;
         }
@@ -544,7 +545,8 @@
             if (errno == EBADF) {
                  JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
             } else {
-                 NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "Peek failed");
+                 JNU_ThrowByNameWithMessageAndLastError
+                     (env, JNU_JAVANETPKG "SocketException", "Peek failed");
             }
         }
         return 0;
@@ -616,7 +618,8 @@
             } else if (errno == EBADF) {
                 JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
             } else {
-                NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "Receive failed");
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, JNU_JAVANETPKG "SocketException", "Receive failed");
 #else
             } else {
                 JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
@@ -681,7 +684,8 @@
             if (errno == EBADF) {
                  JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
             } else {
-                 NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "Receive failed");
+                 JNU_ThrowByNameWithMessageAndLastError
+                     (env, JNU_JAVANETPKG "SocketException", "Receive failed");
             }
         }
     } else {
@@ -827,7 +831,8 @@
                     } else if (errno == EBADF) {
                          JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
                     } else {
-                        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "Receive failed");
+                        JNU_ThrowByNameWithMessageAndLastError
+                            (env, JNU_JAVANETPKG "SocketException", "Receive failed");
 #else
                     } else {
                         JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
@@ -859,7 +864,8 @@
                 if (errno == EBADF) {
                      JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
                  } else {
-                     NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "Receive failed");
+                     JNU_ThrowByNameWithMessageAndLastError
+                         (env, JNU_JAVANETPKG "SocketException", "Receive failed");
                  }
             }
         } else {
@@ -932,8 +938,8 @@
     }
 
     if ((fd = socket(domain, SOCK_DGRAM, 0)) == -1) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                       "Error creating socket");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error creating socket");
         return;
     }
 
@@ -1080,8 +1086,8 @@
 
     if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
                    (const char*)&in, sizeof(in)) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                       "Error setting socket option");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
     }
 }
 
@@ -1109,8 +1115,8 @@
                 "IPV6_MULTICAST_IF failed (interface has IPv4 "
                 "address only?)");
         } else {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                           "Error setting socket option");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
         }
         return;
     }
@@ -1129,8 +1135,8 @@
 
     if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
                    (const char*)&in, sizeof(in)) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                         "Error setting socket option");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
     }
 }
 
@@ -1256,8 +1262,10 @@
     on = (*env)->GetBooleanField(env, value, fid);
     loopback = (!on ? 1 : 0);
 
-    if (NET_SetSockOpt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, (const void *)&loopback, sizeof(char)) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
+    if (NET_SetSockOpt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
+                       (const void *)&loopback, sizeof(char)) < 0) {
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
         return;
     }
 }
@@ -1280,8 +1288,10 @@
     on = (*env)->GetBooleanField(env, value, fid);
     loopback = (!on ? 1 : 0);
 
-    if (NET_SetSockOpt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, (const void *)&loopback, sizeof(int)) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
+    if (NET_SetSockOpt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP,
+                       (const void *)&loopback, sizeof(int)) < 0) {
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
         return;
     }
 
@@ -1420,7 +1430,8 @@
     }
 
     if (NET_SetSockOpt(fd, level, optname, (const void *)&optval, optlen) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
         return;
     }
 }
@@ -1483,8 +1494,8 @@
 
         if (getsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
                        (char *)inP, &len) < 0) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                             "Error getting socket option");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Error getting socket option");
             return NULL;
         }
 
@@ -1581,8 +1592,8 @@
 
         if (getsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
                        (char*)&index, &len) < 0) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                           "Error getting socket option");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Error getting socket option");
             return NULL;
         }
 
@@ -1726,8 +1737,8 @@
         len = SOCKADDR_LEN;
 
         if (getsockname(fd, (struct sockaddr *)&him, &len) == -1) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                           "Error getting socket name");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Error getting socket name");
             return NULL;
         }
         iaObj = NET_SockaddrToInetAddress(env, (struct sockaddr *)&him, &port);
@@ -1752,8 +1763,8 @@
     }
 
     if (NET_GetSockOpt(fd, level, optname, (void *)&optval, &optlen) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                         "Error getting socket option");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error getting socket option");
         return NULL;
     }
 
@@ -1805,8 +1816,8 @@
     char ittl = (char)ttl;
     if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ittl,
                    sizeof(ittl)) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                       "Error setting socket option");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
     }
 }
 
@@ -1818,8 +1829,8 @@
     int ittl = (int)ttl;
     if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
                    (char*)&ittl, sizeof(ittl)) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                       "Error setting socket option");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
     }
 }
 #endif
@@ -1901,8 +1912,8 @@
 
         if (getsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
                        (char*)&ttl, &len) < 0) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                         "Error getting socket option");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Error getting socket option");
             return -1;
         }
         return (jint)ttl;
@@ -1913,8 +1924,8 @@
             socklen_t len = sizeof(ttl);
             if (getsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL,
                            (char*)&ttl, &len) < 0) {
-                NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                               "Error getting socket option");
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, JNU_JAVANETPKG "SocketException", "Error getting socket option");
                 return -1;
             }
             return (jint)ttl;
--- a/jdk/src/java.base/unix/native/libnet/PlainSocketImpl.c	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/unix/native/libnet/PlainSocketImpl.c	Thu Jun 30 10:31:19 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -476,7 +476,8 @@
             JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
                             "Socket closed");
         } else {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "connect failed");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "connect failed");
         }
         return;
     }
@@ -498,8 +499,8 @@
          */
         socklen_t slen = SOCKADDR_LEN;
         if (getsockname(fd, (struct sockaddr *)&him, &slen) == -1) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                           "Error getting socket name");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Error getting socket name");
         } else {
             localport = NET_GetPortFromSockaddr((struct sockaddr *)&him);
             (*env)->SetIntField(env, this, psi_localportID, localport);
@@ -536,8 +537,9 @@
     }
 
     /* bind */
-    if (NET_InetAddressToSockaddr(env, iaObj, localport, (struct sockaddr *)&him, &len, JNI_TRUE) != 0) {
-      return;
+    if (NET_InetAddressToSockaddr(env, iaObj, localport, (struct sockaddr *)&him,
+                                  &len, JNI_TRUE) != 0) {
+        return;
     }
     setDefaultScopeID(env, (struct sockaddr *)&him);
 
@@ -547,8 +549,8 @@
             NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "BindException",
                            "Bind failed");
         } else {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                           "Bind failed");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Bind failed");
         }
         return;
     }
@@ -563,8 +565,8 @@
          * that the system chose for us and store it in the Socket object.
          */
         if (getsockname(fd, (struct sockaddr *)&him, &slen) == -1) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                           "Error getting socket name");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Error getting socket name");
             return;
         }
         localport = NET_GetPortFromSockaddr((struct sockaddr *)&him);
@@ -580,8 +582,8 @@
  * Signature: (I)V
  */
 JNIEXPORT void JNICALL
-Java_java_net_PlainSocketImpl_socketListen (JNIEnv *env, jobject this,
-                                            jint count)
+Java_java_net_PlainSocketImpl_socketListen(JNIEnv *env, jobject this,
+                                           jint count)
 {
     /* this FileDescriptor fd field */
     jobject fdObj = (*env)->GetObjectField(env, this, psi_fdID);
@@ -604,8 +606,8 @@
         count -= 1;
 
     if (listen(fd, count) == -1) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                       "Listen failed");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Listen failed");
     }
 }
 
@@ -684,7 +686,8 @@
             } else if (errno == ENOMEM) {
                JNU_ThrowOutOfMemoryError(env, "NET_Timeout native heap allocation failed");
             } else {
-               NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "Accept failed");
+               JNU_ThrowByNameWithMessageAndLastError
+                   (env, JNU_JAVANETPKG "SocketException", "Accept failed");
             }
             return;
         }
@@ -727,7 +730,8 @@
             if (errno == EBADF) {
                 JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
             } else {
-                NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "Accept failed");
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, JNU_JAVANETPKG "SocketException", "Accept failed");
             }
         }
         return;
@@ -781,8 +785,8 @@
         if (errno == ECONNRESET) {
             JNU_ThrowByName(env, "sun/net/ConnectionResetException", "");
         } else {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                         "ioctl FIONREAD failed");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "ioctl FIONREAD failed");
         }
     }
     return ret;
@@ -936,8 +940,8 @@
             return;
         }
 #endif /* __solaris__ */
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                      "Error setting socket option");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
     }
 }
 
@@ -981,8 +985,8 @@
         len = SOCKADDR_LEN;
 
         if (getsockname(fd, (struct sockaddr *)&him, &len) < 0) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                             "Error getting socket name");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Error getting socket name");
             return -1;
         }
         iaObj = NET_SockaddrToInetAddress(env, (struct sockaddr *)&him, &port);
@@ -1014,8 +1018,8 @@
     }
 
     if (NET_GetSockOpt(fd, level, optname, (void *)&optval, &optlen) < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                      "Error getting socket option");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error getting socket option");
         return -1;
     }
 
@@ -1063,6 +1067,6 @@
     }
     n = NET_Send(fd, (char *)&d, 1, MSG_OOB);
     if (n == -1) {
-        NET_ThrowByNameWithLastError(env, "java/io/IOException", "Write failed");
+        JNU_ThrowIOExceptionWithLastError(env, "Write failed");
     }
 }
--- a/jdk/src/java.base/unix/native/libnet/SocketInputStream.c	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/unix/native/libnet/SocketInputStream.c	Thu Jun 30 10:31:19 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -111,8 +111,8 @@
                 } else if (errno == ENOMEM) {
                     JNU_ThrowOutOfMemoryError(env, "NET_Timeout native heap allocation failed");
                 } else {
-                    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                                  "select/poll failed");
+                    JNU_ThrowByNameWithMessageAndLastError
+                        (env, JNU_JAVANETPKG "SocketException", "select/poll failed");
                 }
             }
             if (bufP != BUF) {
@@ -145,8 +145,8 @@
                      break;
 
                 default:
-                    NET_ThrowByNameWithLastError(env,
-                        JNU_JAVANETPKG "SocketException", "Read failed");
+                    JNU_ThrowByNameWithMessageAndLastError
+                        (env, JNU_JAVANETPKG "SocketException", "Read failed");
             }
         }
     } else {
--- a/jdk/src/java.base/unix/native/libnet/SocketOutputStream.c	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/unix/native/libnet/SocketOutputStream.c	Thu Jun 30 10:31:19 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, 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
@@ -114,8 +114,8 @@
                 JNU_ThrowByName(env, "sun/net/ConnectionResetException",
                     "Connection reset");
             } else {
-                NET_ThrowByNameWithLastError(env, "java/net/SocketException",
-                    "Write failed");
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, "java/net/SocketException", "Write failed");
             }
             if (bufP != BUF) {
                 free(bufP);
--- a/jdk/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c	Thu Jun 30 10:31:19 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
@@ -1713,8 +1713,8 @@
             in.s_addr = htonl(getInetAddress_addr(env, value));
             if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
                                (const char*)&in, sizeof(in)) < 0) {
-                NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "Error setting socket option");
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
             }
             return;
         }
@@ -1741,7 +1741,7 @@
             }
             index = (*env)->GetIntField(env, value, ni_indexID);
 
-            if ( isAdapterIpv6Enabled(env, index) != 0 ) {
+            if (isAdapterIpv6Enabled(env, index) != 0) {
                 if (setsockopt(fd1, IPPROTO_IPV6, IPV6_MULTICAST_IF,
                                (const char*)&index, sizeof(index)) < 0) {
                     if (errno == EINVAL && index > 0) {
@@ -1749,8 +1749,8 @@
                             "IPV6_MULTICAST_IF failed (interface has IPv4 "
                             "address only?)");
                     } else {
-                        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                   "Error setting socket option");
+                        JNU_ThrowByNameWithMessageAndLastError
+                            (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
                     }
                     return;
                 }
@@ -1758,13 +1758,13 @@
             /* If there are any IPv4 addresses on this interface then
              * repeat the operation on the IPv4 fd */
 
-            if (getInet4AddrFromIf (env, value, &in) < 0) {
+            if (getInet4AddrFromIf(env, value, &in) < 0) {
                 return;
             }
             if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
                                (const char*)&in, sizeof(in)) < 0) {
-                NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "Error setting socket option");
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
             }
             return;
         } else {
@@ -1781,8 +1781,8 @@
 
             if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
                                (const char*)&in, sizeof(in)) < 0) {
-                NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                               "Error setting socket option");
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, JNU_JAVANETPKG "SocketException", "Error setting socket option");
             }
             return;
         }
@@ -1932,8 +1932,8 @@
         int len = sizeof(struct in_addr);
         if (getsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
                            (char *)inP, &len) < 0) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                             "Error getting socket option");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Error getting socket option");
             return NULL;
         }
 
@@ -2056,8 +2056,8 @@
         {
             if (getsockopt(fd1, IPPROTO_IPV6, IPV6_MULTICAST_IF,
                                (char*)&index, &len) < 0) {
-                NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                               "Error getting socket option");
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, JNU_JAVANETPKG "SocketException", "Error getting socket option");
                 return NULL;
             }
         }
@@ -2288,8 +2288,8 @@
     }
 
     if (getsockname(fd, (struct sockaddr *)&him, &len) == -1) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                       "Error getting socket name");
+        JNU_ThrowByNameWithMessageAndLastError
+            (env, JNU_JAVANETPKG "SocketException", "Error getting socket name");
         return NULL;
     }
     iaObj = NET_SockaddrToInetAddress(env, (struct sockaddr *)&him, &port);
--- a/jdk/src/java.base/windows/native/libnet/TwoStacksPlainSocketImpl.c	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/java.base/windows/native/libnet/TwoStacksPlainSocketImpl.c	Thu Jun 30 10:31:19 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1054,8 +1054,8 @@
         }
 
         if (getsockname(fd, (struct sockaddr *)&him, &len) < 0) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                             "Error getting socket name");
+            JNU_ThrowByNameWithMessageAndLastError
+                (env, JNU_JAVANETPKG "SocketException", "Error getting socket name");
             return -1;
         }
         iaObj = NET_SockaddrToInetAddress(env, (struct sockaddr *)&him, &port);
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/Jlink.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/Jlink.java	Thu Jun 30 10:31:19 2016 -0700
@@ -32,10 +32,10 @@
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
+import jdk.tools.jlink.internal.ExecutableImage;
 import jdk.tools.jlink.internal.JlinkTask;
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.ExecutableImage;
 import jdk.tools.jlink.builder.ImageBuilder;
 import jdk.tools.jlink.internal.PluginRepository;
 
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java	Thu Jun 30 10:31:19 2016 -0700
@@ -57,7 +57,7 @@
 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.ExecutableImage;
+import jdk.tools.jlink.internal.ExecutableImage;
 import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.PluginException;
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/ImageBuilder.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/ImageBuilder.java	Thu Jun 30 10:31:19 2016 -0700
@@ -27,7 +27,7 @@
 import java.io.DataOutputStream;
 import java.util.Properties;
 
-import jdk.tools.jlink.plugin.ExecutableImage;
+import jdk.tools.jlink.internal.ExecutableImage;
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.ModulePool;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ExecutableImage.java	Thu Jun 30 10:31:19 2016 -0700
@@ -0,0 +1,64 @@
+/*
+ * 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.nio.file.Path;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * An executable runtime image. Contains the information about the executable
+ * image created.
+ */
+public interface ExecutableImage {
+
+    /**
+     * Image home directory,
+     *
+     * @return The home directory.
+     */
+    public Path getHome();
+
+    /**
+     * The names of the modules located in the image.
+     *
+     * @return The set of modules.
+     */
+    public Set<String> getModules();
+
+    /**
+     * The list of arguments required to execute the image.
+     *
+     * @return The list of arguments.
+     */
+    public List<String> getExecutionArgs();
+
+    /**
+     * Store new arguments required to execute the image.
+     *
+     * @param args Additional arguments
+     */
+    public void storeLaunchArgs(List<String> args);
+}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java	Thu Jun 30 10:31:19 2016 -0700
@@ -43,7 +43,6 @@
 import jdk.tools.jlink.internal.Archive.Entry;
 import jdk.tools.jlink.internal.Archive.Entry.EntryType;
 import jdk.tools.jlink.internal.ModulePoolImpl.CompressedModuleData;
-import jdk.tools.jlink.plugin.ExecutableImage;
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.ModuleEntry;
 
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java	Thu Jun 30 10:31:19 2016 -0700
@@ -32,15 +32,12 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-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.PluginException;
 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;
 
 /**
  * Plugins configuration.
@@ -85,7 +82,7 @@
                         + " added more than once to stack ");
             }
             seen.add(plug.getName());
-            Category category = Utils.getCategory(plug);
+            Category category = plug.getType();
             if (category == null) {
                 throw new PluginException("Invalid category for "
                         + plug.getName());
@@ -94,26 +91,13 @@
             lst.add(plug);
         }
 
-        List<TransformerPlugin> transformerPlugins = new ArrayList<>();
-        List<PostProcessorPlugin> postProcessingPlugins = new ArrayList<>();
+        List<Plugin> orderedPlugins = new ArrayList<>();
         plugins.entrySet().stream().forEach((entry) -> {
             // Sort according to plugin constraints
-            List<Plugin> orderedPlugins = PluginOrderingGraph.sort(entry.getValue());
-            Category category = entry.getKey();
-            orderedPlugins.stream().forEach((p) -> {
-                if (category.isPostProcessor()) {
-                    @SuppressWarnings("unchecked")
-                            PostProcessorPlugin pp = (PostProcessorPlugin) p;
-                    postProcessingPlugins.add(pp);
-                } else {
-                    @SuppressWarnings("unchecked")
-                            TransformerPlugin trans = (TransformerPlugin) p;
-                    transformerPlugins.add(trans);
-                }
-            });
+            orderedPlugins.addAll(PluginOrderingGraph.sort(entry.getValue()));
         });
         Plugin lastSorter = null;
-        for (Plugin plugin : transformerPlugins) {
+        for (Plugin plugin : orderedPlugins) {
             if (plugin.getName().equals(pluginsConfiguration.getLastSorterPluginName())) {
                 lastSorter = plugin;
                 break;
@@ -145,7 +129,6 @@
             };
         }
 
-        return new ImagePluginStack(builder, transformerPlugins,
-                lastSorter, postProcessingPlugins);
+        return new ImagePluginStack(builder, orderedPlugins, lastSorter);
     }
 }
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java	Thu Jun 30 10:31:19 2016 -0700
@@ -44,14 +44,11 @@
 
 import jdk.internal.jimage.decompressor.Decompressor;
 import jdk.tools.jlink.plugin.Plugin;
-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.ModulePool;
 import jdk.tools.jlink.plugin.LinkModule;
 import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.PostProcessorPlugin;
 
 /**
  * Plugins Stack. Plugins entry point to apply transformations onto resources
@@ -161,42 +158,34 @@
 
     private final ImageBuilder imageBuilder;
     private final Plugin lastSorter;
-    private final List<TransformerPlugin> contentPlugins = new ArrayList<>();
-    private final List<PostProcessorPlugin> postProcessingPlugins = new ArrayList<>();
+    private final List<Plugin> plugins = new ArrayList<>();
     private final List<ResourcePrevisitor> resourcePrevisitors = new ArrayList<>();
 
 
     public ImagePluginStack() {
-        this(null, Collections.emptyList(), null,
-                Collections.emptyList());
+        this(null, Collections.emptyList(), null);
     }
 
     public ImagePluginStack(ImageBuilder imageBuilder,
-            List<TransformerPlugin> contentPlugins,
-            Plugin lastSorter,
-            List<PostProcessorPlugin> postprocessingPlugins) {
+            List<Plugin> plugins,
+            Plugin lastSorter) {
         this.imageBuilder = Objects.requireNonNull(imageBuilder);
         this.lastSorter = lastSorter;
-        Objects.requireNonNull(contentPlugins);
-        Objects.requireNonNull(postprocessingPlugins);
-        contentPlugins.stream().forEach((p) -> {
+        this.plugins.addAll(Objects.requireNonNull(plugins));
+        plugins.stream().forEach((p) -> {
             Objects.requireNonNull(p);
             if (p instanceof ResourcePrevisitor) {
                 resourcePrevisitors.add((ResourcePrevisitor) p);
             }
-            this.contentPlugins.add(p);
-        });
-        postprocessingPlugins.stream().forEach((p) -> {
-            Objects.requireNonNull(p);
-            this.postProcessingPlugins.add(p);
         });
     }
 
     public void operate(ImageProvider provider) throws Exception {
         ExecutableImage img = provider.retrieve(this);
         List<String> arguments = new ArrayList<>();
-        postProcessingPlugins.stream()
-                .map((plugin) -> plugin.process(img))
+        plugins.stream()
+                .filter(PostProcessor.class::isInstance)
+                .map((plugin) -> ((PostProcessor)plugin).process(img))
                 .filter((lst) -> (lst != null))
                 .forEach((lst) -> {
                      arguments.addAll(lst);
@@ -241,7 +230,7 @@
 
         ModulePoolImpl current = resources;
         List<ModuleEntry> frozenOrder = null;
-        for (TransformerPlugin p : contentPlugins) {
+        for (Plugin p : plugins) {
             current.setReadOnly();
             ModulePoolImpl output = null;
             if (p == lastSorter) {
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java	Thu Jun 30 10:31:19 2016 -0700
@@ -49,7 +49,6 @@
 import jdk.tools.jlink.internal.TaskHelper.Option;
 import jdk.tools.jlink.internal.TaskHelper.OptionsHelper;
 import jdk.tools.jlink.internal.ImagePluginStack.ImageProvider;
-import jdk.tools.jlink.plugin.ExecutableImage;
 import jdk.tools.jlink.Jlink.JlinkConfiguration;
 import jdk.tools.jlink.Jlink.PluginsConfiguration;
 import jdk.tools.jlink.plugin.PluginException;
@@ -184,8 +183,8 @@
                 optionsHelper.showHelp(PROGNAME);
                 return EXIT_OK;
             }
-            if (optionsHelper.listPlugins()) {
-                optionsHelper.listPlugins(true);
+            if (optionsHelper.shouldListPlugins()) {
+                optionsHelper.listPlugins();
                 return EXIT_OK;
             }
             if (options.version || options.fullVersion) {
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java	Thu Jun 30 10:31:19 2016 -0700
@@ -34,8 +34,6 @@
 import java.util.ServiceLoader;
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.PostProcessorPlugin;
-import jdk.tools.jlink.plugin.TransformerPlugin;
 
 /**
  *
@@ -59,17 +57,7 @@
      */
     public static Plugin getPlugin(String name,
             Layer pluginsLayer) {
-        Plugin tp = getPlugin(TransformerPlugin.class, name, pluginsLayer);
-        Plugin ppp = getPlugin(PostProcessorPlugin.class, name, pluginsLayer);
-
-        // We should not have a transformer plugin and a post processor plugin
-        // of the same name. That kind of duplicate is detected here.
-        if (tp != null && ppp != null) {
-            throw new PluginException("Multiple plugin "
-                        + "for the name " + name);
-        }
-
-        return tp != null? tp : ppp;
+        return getPlugin(Plugin.class, name, pluginsLayer);
     }
 
     /**
@@ -112,10 +100,7 @@
     }
 
     public static List<Plugin> getPlugins(Layer pluginsLayer) {
-        List<Plugin> plugins = new ArrayList<>();
-        plugins.addAll(getPlugins(TransformerPlugin.class, pluginsLayer));
-        plugins.addAll(getPlugins(PostProcessorPlugin.class, pluginsLayer));
-        return plugins;
+        return getPlugins(Plugin.class, pluginsLayer);
     }
 
     private static <T extends Plugin> T getPlugin(Class<T> clazz, String name,
@@ -138,10 +123,10 @@
     }
 
     /**
-     * The post processors accessible in the current context.
+     * The plugins accessible in the current context.
      *
      * @param pluginsLayer
-     * @return The list of post processors.
+     * @return The list of plugins.
      */
     private static <T extends Plugin> List<T> getPlugins(Class<T> clazz, Layer pluginsLayer) {
         Objects.requireNonNull(pluginsLayer);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PostProcessor.java	Thu Jun 30 10:31:19 2016 -0700
@@ -0,0 +1,42 @@
+/*
+ * 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.util.List;
+
+/**
+ * Plugin wishing to post-proces must implement this interface. PostProcessors
+ * are called once the image has been generated and is executable.
+ **/
+public interface PostProcessor {
+
+    /**
+     * Post process an image.
+     *
+     * @param image The executable image.
+     * @return The list of arguments to add to launchers (if any).
+     */
+    public List<String> process(ExecutableImage image);
+}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Thu Jun 30 10:31:19 2016 -0700
@@ -428,7 +428,7 @@
             return opt.hasArg;
         }
 
-        public boolean listPlugins() {
+        public boolean shouldListPlugins() {
             return pluginOptions.listPlugins;
         }
 
@@ -570,26 +570,19 @@
             log.println(bundleHelper.getMessage("main.command.files"));
         }
 
-        public void listPlugins(boolean showsImageBuilder) {
+        public void listPlugins() {
             log.println("\n" + bundleHelper.getMessage("main.extended.help"));
             List<Plugin> pluginList = PluginRepository.
                     getPlugins(pluginOptions.pluginsLayer);
-            for (Plugin plugin : Utils.
-                    getSortedPreProcessors(pluginList)) {
-                showPlugin(plugin, log, showsImageBuilder);
-            }
-
-            if (showsImageBuilder) {
-                for (Plugin plugin : Utils.getSortedPostProcessors(pluginList)) {
-                    showPlugin(plugin, log, showsImageBuilder);
-                }
+            for (Plugin plugin : Utils.getSortedPlugins(pluginList)) {
+                showPlugin(plugin, log);
             }
 
             log.println("\n" + bundleHelper.getMessage("main.extended.help.footer"));
         }
 
-        private void showPlugin(Plugin plugin, PrintWriter log, boolean showsImageBuilder) {
-            if (showsPlugin(plugin, showsImageBuilder)) {
+        private void showPlugin(Plugin plugin, PrintWriter log) {
+            if (showsPlugin(plugin)) {
                 log.println("\n" + bundleHelper.getMessage("main.plugin.name")
                         + ": " + plugin.getName());
 
@@ -599,7 +592,7 @@
                          + ": " + plugin.getClass().getName());
                     log.println(bundleHelper.getMessage("main.plugin.module")
                          + ": " + plugin.getClass().getModule().getName());
-                    Category category = Utils.getCategory(plugin);
+                    Category category = plugin.getType();
                     log.println(bundleHelper.getMessage("main.plugin.category")
                          + ": " + category.getName());
                     log.println(bundleHelper.getMessage("main.plugin.state")
@@ -722,14 +715,8 @@
         }
     }
 
-    // Display all plugins or pre processors only.
-    private static boolean showsPlugin(Plugin plugin, boolean showsImageBuilder) {
-        if (!Utils.isDisabled(plugin) && plugin.getOption() != null) {
-            if (Utils.isPostProcessor(plugin) && !showsImageBuilder) {
-                return false;
-            }
-            return true;
-        }
-        return false;
+    // Display all plugins
+    private static boolean showsPlugin(Plugin plugin) {
+        return (!Utils.isDisabled(plugin) && plugin.getOption() != null);
     }
 }
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java	Thu Jun 30 10:31:19 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,51 +55,10 @@
                      .collect(Collectors.toList());
     }
 
-    public static boolean isPostProcessor(Plugin provider) {
-        return provider.getType().isPostProcessor();
-    }
 
-    public static boolean isPreProcessor(Plugin provider) {
-        return !isPostProcessor(provider);
-    }
-
-    public static Category getCategory(Plugin provider) {
-        return provider.getType();
-    }
-
-    public static List<Plugin> getPreProcessors(List<Plugin> plugins) {
+    public static List<Plugin> getSortedPlugins(List<Plugin> plugins) {
         List<Plugin> res = new ArrayList<>();
-        for (Plugin p : plugins) {
-            if (isPreProcessor(p)) {
-                res.add(p);
-            }
-        }
-        return res;
-    }
-
-    public static List<Plugin> getPostProcessors(List<Plugin> plugins) {
-        List<Plugin> res = new ArrayList<>();
-        for (Plugin p : plugins) {
-            if (isPostProcessor(p)) {
-                res.add(p);
-            }
-        }
-        return res;
-    }
-
-    public static List<Plugin> getSortedPostProcessors(List<Plugin> plugins) {
-        List<Plugin> res = getPostProcessors(plugins);
-        res.sort(new Comparator<Plugin>() {
-            @Override
-            public int compare(Plugin o1, Plugin o2) {
-                return o1.getName().compareTo(o2.getName());
-            }
-        });
-        return res;
-    }
-
-    public static List<Plugin> getSortedPreProcessors(List<Plugin> plugins) {
-        List<Plugin> res = getPreProcessors(plugins);
+        res.addAll(plugins);
         res.sort(new Comparator<Plugin>() {
             @Override
             public int compare(Plugin o1, Plugin o2) {
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -28,7 +28,7 @@
 
 import jdk.tools.jlink.internal.ModulePoolImpl;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.internal.ImagePluginStack;
 import jdk.tools.jlink.internal.ResourcePrevisitor;
 import jdk.tools.jlink.internal.StringTable;
@@ -37,7 +37,7 @@
  *
  * ZIP and String Sharing compression plugin
  */
-public final class DefaultCompressPlugin implements TransformerPlugin, ResourcePrevisitor {
+public final class DefaultCompressPlugin implements Plugin, ResourcePrevisitor {
     public static final String NAME = "compress";
     public static final String FILTER = "filter";
     public static final String LEVEL_0 = "0";
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeFilesPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeFilesPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -26,7 +26,7 @@
 
 import java.util.Map;
 import java.util.function.Predicate;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.ModuleEntry;
 
@@ -34,7 +34,7 @@
  *
  * Exclude files plugin
  */
-public final class ExcludeFilesPlugin implements TransformerPlugin {
+public final class ExcludeFilesPlugin implements Plugin {
 
     public static final String NAME = "exclude-files";
     private Predicate<String> predicate;
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludePlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludePlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -26,7 +26,7 @@
 
 import java.util.Map;
 import java.util.function.Predicate;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
 
@@ -34,7 +34,7 @@
  *
  * Exclude resources plugin
  */
-public final class ExcludePlugin implements TransformerPlugin {
+public final class ExcludePlugin implements Plugin {
 
     public static final String NAME = "exclude-resources";
     private Predicate<String> predicate;
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -35,7 +35,7 @@
 import java.util.TreeSet;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.PluginException;
@@ -44,7 +44,7 @@
  *
  * Exclude VM plugin
  */
-public final class ExcludeVMPlugin implements TransformerPlugin {
+public final class ExcludeVMPlugin implements Plugin {
 
     private static final class JvmComparator implements Comparator<Jvm> {
 
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/FileCopierPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/FileCopierPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -41,14 +41,14 @@
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.internal.Utils;
 
 /**
  *
  * Copy files to image from various locations.
  */
-public class FileCopierPlugin implements TransformerPlugin {
+public class FileCopierPlugin implements Plugin {
 
     public static final String NAME = "copy-files";
 
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -34,12 +34,12 @@
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 
 /**
  * Plugin to generate java.lang.invoke classes.
  */
-public final class GenerateJLIClassesPlugin implements TransformerPlugin {
+public final class GenerateJLIClassesPlugin implements Plugin {
 
     private static final String NAME = "generate-jli-classes";
 
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -44,7 +44,7 @@
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 
 /**
  * Plugin to explicitly specify the locale data included in jdk.localedata
@@ -68,7 +68,7 @@
  *     start with at least one white space character, e.g., " ar ar-EG ..."
  *                                                           ^
  */
-public final class IncludeLocalesPlugin implements TransformerPlugin, ResourcePrevisitor {
+public final class IncludeLocalesPlugin implements Plugin, ResourcePrevisitor {
 
     public static final String NAME = "include-locales";
     private static final String MODULENAME = "jdk.localedata";
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OrderResourcesPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OrderResourcesPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -37,14 +37,14 @@
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.internal.Utils;
 
 /**
  *
  * Order Resources plugin
  */
-public final class OrderResourcesPlugin implements TransformerPlugin {
+public final class OrderResourcesPlugin implements Plugin {
     public static final String NAME = "order-resources";
     private static final FileSystem JRT_FILE_SYSTEM = Utils.jrtFileSystem();
 
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -36,12 +36,12 @@
 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;
+import jdk.tools.jlink.plugin.Plugin;
 
 /**
  * This plugin adds/deletes information for 'release' file.
  */
-public final class ReleaseInfoPlugin implements TransformerPlugin {
+public final class ReleaseInfoPlugin implements Plugin {
     // option name
     public static final String NAME = "release-info";
     public static final String KEYS = "keys";
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StringSharingPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StringSharingPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -56,7 +56,7 @@
 import jdk.internal.jimage.decompressor.SignatureParser;
 import jdk.internal.jimage.decompressor.StringSharingDecompressor;
 import jdk.tools.jlink.internal.ModulePoolImpl;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
@@ -68,7 +68,7 @@
  * A Plugin that stores the image classes constant pool UTF_8 entries into the
  * Image StringsTable.
  */
-public class StringSharingPlugin implements TransformerPlugin, ResourcePrevisitor {
+public class StringSharingPlugin implements Plugin, ResourcePrevisitor {
 
     public static final String NAME = "compact-cp";
 
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripDebugPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripDebugPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -29,13 +29,13 @@
 import jdk.internal.org.objectweb.asm.ClassWriter;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 
 /**
  *
  * Strip debug attributes plugin
  */
-public final class StripDebugPlugin implements TransformerPlugin {
+public final class StripDebugPlugin implements Plugin {
     public static final String NAME = "strip-debug";
     private final Predicate<String> predicate;
 
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripNativeCommandsPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripNativeCommandsPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -26,13 +26,13 @@
 
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 
 /**
  *
  * Strip Native Commands plugin
  */
-public final class StripNativeCommandsPlugin implements TransformerPlugin {
+public final class StripNativeCommandsPlugin implements Plugin {
 
     public static final String NAME = "strip-native-commands";
 
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModuleDescriptorPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModuleDescriptorPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -52,7 +52,7 @@
 import static jdk.internal.org.objectweb.asm.Opcodes.*;
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.internal.plugins.SystemModuleDescriptorPlugin.Builder.*;
 import jdk.tools.jlink.plugin.ModuleEntry;
 
@@ -67,7 +67,7 @@
  * @see java.lang.module.SystemModuleFinder
  * @see SystemModules
  */
-public final class SystemModuleDescriptorPlugin implements TransformerPlugin {
+public final class SystemModuleDescriptorPlugin implements Plugin {
     private static final JavaLangModuleAccess JLMA = SharedSecrets.getJavaLangModuleAccess();
 
     // TODO: packager has the dependency on the plugin name
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ZipPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ZipPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -34,13 +34,13 @@
 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.plugin.Plugin;
 
 /**
  *
  * ZIP Compression plugin
  */
-public final class ZipPlugin implements TransformerPlugin {
+public final class ZipPlugin implements Plugin {
 
     public static final String NAME = "zip";
     private Predicate<String> predicate;
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -25,7 +25,7 @@
 package jdk.tools.jlink.internal.plugins.asm;
 
 import java.util.Objects;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.internal.ModulePoolImpl;
@@ -35,7 +35,7 @@
  * resources.
  *
  */
-public abstract class AsmPlugin implements TransformerPlugin {
+public abstract class AsmPlugin implements Plugin {
 
     public AsmPlugin() {
     }
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/ExecutableImage.java	Wed Jun 29 21:49:41 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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.nio.file.Path;
-import java.util.List;
-import java.util.Set;
-
-/**
- * An executable runtime image. Contains the information about the executable
- * image created.
- */
-public interface ExecutableImage {
-
-    /**
-     * Image home directory,
-     *
-     * @return The home directory.
-     */
-    public Path getHome();
-
-    /**
-     * The names of the modules located in the image.
-     *
-     * @return The set of modules.
-     */
-    public Set<String> getModules();
-
-    /**
-     * The list of arguments required to execute the image.
-     *
-     * @return The list of arguments.
-     */
-    public List<String> getExecutionArgs();
-
-    /**
-     * Store new arguments required to execute the image.
-     *
-     * @param args Additional arguments
-     */
-    public void storeLaunchArgs(List<String> args);
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Plugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Plugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -57,29 +57,19 @@
         SORTER("SORTER"),
         COMPRESSOR("COMPRESSOR"),
         METAINFO_ADDER("METAINFO_ADDER"),
-        VERIFIER("VERIFIER", true),
-        PROCESSOR("PROCESSOR", true),
-        PACKAGER("PACKAGER", true);
+        VERIFIER("VERIFIER"),
+        PROCESSOR("PROCESSOR"),
+        PACKAGER("PACKAGER");
 
         private final String name;
-        private final boolean postProcessor;
-
-        Category(String name, boolean postProcessor) {
-            this.name = name;
-            this.postProcessor = postProcessor;
-        }
 
         Category(String name) {
-            this(name, false);
+            this.name = name;
         }
 
         public String getName() {
             return name;
         }
-
-        public boolean isPostProcessor() {
-            return postProcessor;
-        }
     }
 
     /**
@@ -209,4 +199,15 @@
      */
     public default void configure(Map<String, String> config) {
     }
+
+    /**
+     * Visit the content of the modules that are composing the image.
+     *
+     * @param in Read only content.
+     * @param out The pool to fill with content. This pool must contain
+     * the result of the visit.
+     *
+     * @throws PluginException
+     */
+    public void visit(ModulePool in, ModulePool out);
 }
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/PostProcessorPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +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.util.List;
-
-/**
- * Implement this interface to develop a PostProcessor plugin.
- * PostProcessor plugins are called once the image has been generated and is executable.
- **/
-public interface PostProcessorPlugin extends Plugin {
-
-    /**
-     * Post process an image.
-     *
-     * @param image The executable image.
-     * @return The list of arguments to add to launchers (if any).
-     */
-    public List<String> process(ExecutableImage image);
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/TransformerPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +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;
-
-
-/**
- * Implement this interface to develop a Transformer plugin.
- * TransformerPlugin are called during image creation. This kind of plugin aims to
- * modify the content of the runtime image.
- */
-public interface TransformerPlugin extends Plugin {
-    /**
-     * Visit the content of the modules that are composing the image.
-     *
-     * @param in Read only content.
-     * @param out The pool to fill with content. This pool must contain
-     * the result of the visit.
-     *
-     * @throws PluginException
-     */
-    public void visit(ModulePool in, ModulePool out);
-}
--- a/jdk/src/jdk.jlink/share/classes/module-info.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/module-info.java	Thu Jun 30 10:31:19 2016 -0700
@@ -29,20 +29,19 @@
     requires jdk.internal.opt;
     requires jdk.jdeps;
 
-    uses jdk.tools.jlink.plugin.TransformerPlugin;
-    uses jdk.tools.jlink.plugin.PostProcessorPlugin;
+    uses jdk.tools.jlink.plugin.Plugin;
 
-    provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.FileCopierPlugin;
-    provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.StripDebugPlugin;
-    provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.ExcludePlugin;
-    provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.ExcludeFilesPlugin;
-    provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.SystemModuleDescriptorPlugin;
-    provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.StripNativeCommandsPlugin;
-    provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.OrderResourcesPlugin;
-    provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.DefaultCompressPlugin;
-    provides jdk.tools.jlink.plugin.TransformerPlugin with jdk.tools.jlink.internal.plugins.OptimizationPlugin;
-    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.TransformerPlugin with jdk.tools.jlink.internal.plugins.ReleaseInfoPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.FileCopierPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.StripDebugPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.ExcludePlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.ExcludeFilesPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.SystemModuleDescriptorPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.StripNativeCommandsPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.OrderResourcesPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.DefaultCompressPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.OptimizationPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.ExcludeVMPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.IncludeLocalesPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.GenerateJLIClassesPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.ReleaseInfoPlugin;
 }
--- a/jdk/test/javax/net/ssl/Stapling/SSLSocketWithStapling.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/javax/net/ssl/Stapling/SSLSocketWithStapling.java	Thu Jun 30 10:31:19 2016 -0700
@@ -510,25 +510,27 @@
         sslc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
 
         SSLServerSocketFactory sslssf = sslc.getServerSocketFactory();
-        SSLServerSocket sslServerSocket =
-            (SSLServerSocket) sslssf.createServerSocket(serverPort);
 
-        serverPort = sslServerSocket.getLocalPort();
+        try (SSLServerSocket sslServerSocket =
+                (SSLServerSocket) sslssf.createServerSocket(serverPort)) {
 
-        /*
-         * Signal Client, we're ready for his connect.
-         */
-        serverReady = true;
+            serverPort = sslServerSocket.getLocalPort();
+
+            /*
+             * Signal Client, we're ready for his connect.
+             */
+            serverReady = true;
 
-        try (SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept();
-                InputStream sslIS = sslSocket.getInputStream();
-                OutputStream sslOS = sslSocket.getOutputStream()) {
-            int numberIn = sslIS.read();
-            int numberSent = 85;
-            log("Server received number: " + numberIn);
-            sslOS.write(numberSent);
-            sslOS.flush();
-            log("Server sent number: " + numberSent);
+            try (SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept();
+                    InputStream sslIS = sslSocket.getInputStream();
+                    OutputStream sslOS = sslSocket.getOutputStream()) {
+                int numberIn = sslIS.read();
+                int numberSent = 85;
+                log("Server received number: " + numberIn);
+                sslOS.write(numberSent);
+                sslOS.flush();
+                log("Server sent number: " + numberSent);
+            }
         }
     }
 
--- a/jdk/test/sun/security/tools/keytool/standard.sh	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/sun/security/tools/keytool/standard.sh	Thu Jun 30 10:31:19 2016 -0700
@@ -25,6 +25,7 @@
 # @summary (almost) all keytool behaviors
 # @author Weijun Wang
 # @run shell/timeout=600 standard.sh
+# @key intermittent
 #
 # This test is always excecuted.
 #
--- a/jdk/test/tools/jlink/DefaultProviderTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/DefaultProviderTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -33,7 +33,6 @@
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
 import tests.Helper;
 
 /*
@@ -60,7 +59,7 @@
         expectedOptions.put("option2", "value2");
     }
 
-    private static class Custom implements TransformerPlugin {
+    private static class Custom implements Plugin {
         private boolean enabled = true;
 
         @Override
--- a/jdk/test/tools/jlink/ImageFileCreatorTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/ImageFileCreatorTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -37,7 +37,7 @@
 import jdk.tools.jlink.internal.Archive;
 import jdk.tools.jlink.internal.ImageFileCreator;
 import jdk.tools.jlink.internal.ImagePluginStack;
-import jdk.tools.jlink.plugin.ExecutableImage;
+import jdk.tools.jlink.internal.ExecutableImage;
 import jdk.tools.jlink.builder.ImageBuilder;
 import jdk.tools.jlink.plugin.ModulePool;
 
@@ -220,7 +220,7 @@
         };
 
         ImagePluginStack stack = new ImagePluginStack(noopBuilder, Collections.emptyList(),
-                null, Collections.emptyList());
+                null);
 
         ImageFileCreator.create(archives, ByteOrder.nativeOrder(), stack);
     }
--- a/jdk/test/tools/jlink/IntegrationTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/IntegrationTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -34,17 +34,17 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Function;
 import jdk.tools.jlink.Jlink;
 import jdk.tools.jlink.Jlink.JlinkConfiguration;
 import jdk.tools.jlink.Jlink.PluginsConfiguration;
 import jdk.tools.jlink.builder.DefaultImageBuilder;
-import jdk.tools.jlink.plugin.ExecutableImage;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.PostProcessorPlugin;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
+import jdk.tools.jlink.internal.ExecutableImage;
+import jdk.tools.jlink.internal.PostProcessor;
 import jdk.tools.jlink.internal.plugins.DefaultCompressPlugin;
 import jdk.tools.jlink.internal.plugins.StripDebugPlugin;
-import jdk.tools.jlink.plugin.Plugin;
 
 import tests.Helper;
 import tests.JImageGenerator;
@@ -70,7 +70,7 @@
 
     private static final List<Integer> ordered = new ArrayList<>();
 
-    public static class MyPostProcessor implements PostProcessorPlugin {
+    public static class MyPostProcessor implements PostProcessor, Plugin {
 
         public static final String NAME = "mypostprocessor";
 
@@ -98,9 +98,14 @@
         public void configure(Map<String, String> config) {
             throw new UnsupportedOperationException("Shouldn't be called");
         }
+
+        @Override
+        public void visit(ModulePool in, ModulePool out) {
+            in.transformAndCopy(Function.identity(), out);
+        }
     }
 
-    public static class MyPlugin1 implements TransformerPlugin {
+    public static class MyPlugin1 implements Plugin {
 
         Integer index;
         Set<String> after;
--- a/jdk/test/tools/jlink/JLinkOptionsTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/JLinkOptionsTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -26,7 +26,7 @@
 import java.util.Set;
 import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.internal.PluginRepository;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 
 import tests.Helper;
 
@@ -46,7 +46,7 @@
  */
 public class JLinkOptionsTest {
 
-    private static class TestPlugin implements TransformerPlugin {
+    private static class TestPlugin implements Plugin {
         private final String name;
         private final String option;
 
--- a/jdk/test/tools/jlink/JLinkPostProcessingTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/JLinkPostProcessingTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -28,10 +28,13 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
 
+import jdk.tools.jlink.plugin.Plugin;
+import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.internal.PluginRepository;
-import jdk.tools.jlink.plugin.ExecutableImage;
-import jdk.tools.jlink.plugin.PostProcessorPlugin;
+import jdk.tools.jlink.internal.PostProcessor;
+import jdk.tools.jlink.internal.ExecutableImage;
 import tests.Helper;
 
 /*
@@ -50,7 +53,7 @@
  */
 public class JLinkPostProcessingTest {
 
-    private static class PPPlugin implements PostProcessorPlugin {
+    private static class PPPlugin implements PostProcessor, Plugin {
 
         private static ExecutableImage called;
         private static final String NAME = "pp";
@@ -68,6 +71,11 @@
         }
 
         @Override
+        public void visit(ModulePool in, ModulePool out) {
+            in.transformAndCopy(Function.identity(), out);
+        }
+
+        @Override
         public String getName() {
             return NAME;
         }
--- a/jdk/test/tools/jlink/JLinkTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/JLinkTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -35,7 +35,6 @@
 import java.util.stream.Stream;
 
 import jdk.tools.jlink.plugin.Plugin;
-import jdk.tools.jlink.plugin.TransformerPlugin;
 import jdk.tools.jlink.internal.PluginRepository;
 import tests.Helper;
 import tests.JImageGenerator;
@@ -60,7 +59,7 @@
     private static int getNumJlinkPlugins() {
         ModuleDescriptor desc = Plugin.class.getModule().getDescriptor();
         return desc.provides().
-                    get(TransformerPlugin.class.getName()).
+                    get(Plugin.class.getName()).
                     providers().size();
     }
 
--- a/jdk/test/tools/jlink/customplugin/module-info.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/customplugin/module-info.java	Thu Jun 30 10:31:19 2016 -0700
@@ -23,6 +23,6 @@
 
 module customplugin {
     requires jdk.jlink;
-    provides jdk.tools.jlink.plugin.TransformerPlugin with plugin.HelloPlugin;
-    provides jdk.tools.jlink.plugin.TransformerPlugin with plugin.CustomPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with plugin.HelloPlugin;
+    provides jdk.tools.jlink.plugin.Plugin with plugin.CustomPlugin;
 }
--- a/jdk/test/tools/jlink/customplugin/plugin/CustomPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/customplugin/plugin/CustomPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -27,9 +27,9 @@
 import java.util.function.Function;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 
-public class CustomPlugin implements TransformerPlugin {
+public class CustomPlugin implements Plugin {
 
     private final static String NAME = "custom-plugin";
 
--- a/jdk/test/tools/jlink/customplugin/plugin/HelloPlugin.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/customplugin/plugin/HelloPlugin.java	Thu Jun 30 10:31:19 2016 -0700
@@ -29,12 +29,12 @@
 import java.util.Map;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 
 /**
  * Custom plugin
  */
-public final class HelloPlugin implements TransformerPlugin {
+public final class HelloPlugin implements Plugin {
 
     private static final String OUTPUT_FILE = "customplugin.txt";
     public static final String NAME = "hello";
--- a/jdk/test/tools/jlink/plugins/CompressorPluginTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/plugins/CompressorPluginTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -61,7 +61,6 @@
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
 
 public class CompressorPluginTest {
 
@@ -279,9 +278,8 @@
             ModulePoolImpl inputResources,
             ModuleEntry res,
             List<Pattern> includesPatterns) {
-        TransformerPlugin compressor = (TransformerPlugin) plugin;
         ModulePool compressedModulePool = new ModulePoolImpl(ByteOrder.nativeOrder(), inputResources.getStringTable());
-        compressor.visit(inputResources, compressedModulePool);
+        plugin.visit(inputResources, compressedModulePool);
         String path = res.getPath();
         ModuleEntry compressed = compressedModulePool.findEntry(path).get();
         CompressedResourceHeader header
--- a/jdk/test/tools/jlink/plugins/ExcludeFilesPluginTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/plugins/ExcludeFilesPluginTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -40,7 +40,6 @@
 import jdk.tools.jlink.internal.plugins.ExcludeFilesPlugin;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
 
 public class ExcludeFilesPluginTest {
     public static void main(String[] args) throws Exception {
--- a/jdk/test/tools/jlink/plugins/ExcludeVMPluginTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/plugins/ExcludeVMPluginTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -38,7 +38,6 @@
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.ModulePool;
 import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.TransformerPlugin;
 
 public class ExcludeVMPluginTest {
 
@@ -173,7 +172,7 @@
         }
         ModulePool out = new ModulePoolImpl();
 
-        TransformerPlugin p = new ExcludeVMPlugin();
+        Plugin p = new ExcludeVMPlugin();
         Map<String, String> config = new HashMap<>();
         if (vm != null) {
             config.put(ExcludeVMPlugin.NAME, vm);
--- a/jdk/test/tools/jlink/plugins/LastSorterTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/plugins/LastSorterTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -45,7 +45,6 @@
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
 
 public class LastSorterTest {
 
@@ -167,7 +166,7 @@
         }
     }
 
-    public static class SorterPlugin implements TransformerPlugin {
+    public static class SorterPlugin implements Plugin {
 
         private final String name;
         private String starts;
--- a/jdk/test/tools/jlink/plugins/OrderResourcesPluginTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/plugins/OrderResourcesPluginTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -42,7 +42,7 @@
 import jdk.tools.jlink.internal.plugins.OrderResourcesPlugin;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 
 public class OrderResourcesPluginTest {
 
@@ -93,7 +93,7 @@
             ModulePool out = new ModulePoolImpl();
             Map<String, String> config = new HashMap<>();
             config.put(OrderResourcesPlugin.NAME, "/zazou/**,**/module-info.class");
-            TransformerPlugin p = new OrderResourcesPlugin();
+            Plugin p = new OrderResourcesPlugin();
             p.configure(config);
             p.visit(resources, out);
             check(out.entries().collect(Collectors.toList()), sorted);
@@ -116,7 +116,7 @@
             ModulePool out = new ModulePoolImpl();
             Map<String, String> config = new HashMap<>();
             config.put(OrderResourcesPlugin.NAME, "@" + order.getAbsolutePath());
-            TransformerPlugin p = new OrderResourcesPlugin();
+            Plugin p = new OrderResourcesPlugin();
             p.configure(config);
             p.visit(resources, out);
             check(out.entries().collect(Collectors.toList()), sorted2);
--- a/jdk/test/tools/jlink/plugins/PluginOrderTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/plugins/PluginOrderTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -46,7 +46,6 @@
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.Plugin.Category;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
 
 public class PluginOrderTest {
 
@@ -225,7 +224,7 @@
         PluginOrderingGraph.sort(plugins);
     }
 
-    private static class Plug implements TransformerPlugin {
+    private static class Plug implements Plugin {
 
         private final Set<String> isBefore;
         private final Set<String> isAfter;
--- a/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -44,7 +44,6 @@
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
 
 public class PluginsNegativeTest {
 
@@ -117,7 +116,7 @@
         }
     }
 
-    public static class CustomPlugin implements TransformerPlugin {
+    public static class CustomPlugin implements Plugin {
 
         private final String name;
 
--- a/jdk/test/tools/jlink/plugins/PrevisitorTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/plugins/PrevisitorTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -49,7 +49,6 @@
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
 
 public class PrevisitorTest {
 
@@ -107,7 +106,7 @@
         }
     }
 
-    private static class CustomPlugin implements TransformerPlugin, ResourcePrevisitor {
+    private static class CustomPlugin implements Plugin, ResourcePrevisitor {
 
         private static String NAME = "plugin";
 
--- a/jdk/test/tools/jlink/plugins/StringSharingPluginTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/plugins/StringSharingPluginTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -57,7 +57,7 @@
 import jdk.tools.jlink.internal.plugins.StringSharingPlugin;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 import tests.Helper;
 import tests.JImageValidator;
 
@@ -119,7 +119,7 @@
         try (java.util.stream.Stream<Path> stream = Files.walk(compiledClasses)) {
             stream.forEach(c);
         }
-        TransformerPlugin plugin = new StringSharingPlugin();
+        Plugin plugin = new StringSharingPlugin();
         ModulePoolImpl result = new ModulePoolImpl(resources.getByteOrder(), resources.getStringTable());
         plugin.visit(resources, result);
 
--- a/jdk/test/tools/jlink/plugins/StripDebugPluginTest.java	Wed Jun 29 21:49:41 2016 -0700
+++ b/jdk/test/tools/jlink/plugins/StripDebugPluginTest.java	Thu Jun 30 10:31:19 2016 -0700
@@ -58,7 +58,7 @@
 import jdk.tools.jlink.internal.plugins.StripDebugPlugin;
 import jdk.tools.jlink.plugin.ModuleEntry;
 import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.plugin.TransformerPlugin;
+import jdk.tools.jlink.plugin.Plugin;
 import tests.Helper;
 
 public class StripDebugPluginTest {
@@ -124,7 +124,7 @@
         checkDebugAttributes(result1.getBytes());
     }
 
-    private ModuleEntry stripDebug(TransformerPlugin debug, ModuleEntry classResource,
+    private ModuleEntry stripDebug(Plugin debug, ModuleEntry classResource,
             String path, String infoPath, byte[] moduleInfo) throws Exception {
         ModulePool resources = new ModulePoolImpl();
         resources.add(classResource);