changeset 1211:b659a7cee935

Merge
author duke
date Wed, 05 Jul 2017 16:41:34 +0200
parents 7798f9e88bf9 3e5496df0d2b
children d718a4419361
files jdk/src/share/classes/com/sun/jmx/interceptor/MBeanServerSupport.java jdk/src/share/classes/java/nio/channels/package.html jdk/src/share/classes/sun/nio/ch/OptionAdaptor.java jdk/src/share/classes/sun/nio/ch/SocketOpts.java jdk/src/share/classes/sun/nio/ch/SocketOptsImpl.java jdk/src/share/classes/sun/nio/ch/exceptions jdk/src/solaris/classes/sun/awt/motif/MButtonPeer.java jdk/src/solaris/classes/sun/awt/motif/MCanvasPeer.java jdk/src/solaris/classes/sun/awt/motif/MCheckboxMenuItemPeer.java jdk/src/solaris/classes/sun/awt/motif/MCheckboxPeer.java jdk/src/solaris/classes/sun/awt/motif/MChoicePeer.java jdk/src/solaris/classes/sun/awt/motif/MComponentPeer.java jdk/src/solaris/classes/sun/awt/motif/MCustomCursor.java jdk/src/solaris/classes/sun/awt/motif/MDataTransferer.java jdk/src/solaris/classes/sun/awt/motif/MDialogPeer.java jdk/src/solaris/classes/sun/awt/motif/MDragSourceContextPeer.java jdk/src/solaris/classes/sun/awt/motif/MDropTargetContextPeer.java jdk/src/solaris/classes/sun/awt/motif/MEmbedCanvasPeer.java jdk/src/solaris/classes/sun/awt/motif/MEmbeddedFrame.java jdk/src/solaris/classes/sun/awt/motif/MEmbeddedFramePeer.java jdk/src/solaris/classes/sun/awt/motif/MFileDialogPeer.java jdk/src/solaris/classes/sun/awt/motif/MFramePeer.java jdk/src/solaris/classes/sun/awt/motif/MGlobalCursorManager.java jdk/src/solaris/classes/sun/awt/motif/MInputMethod.java jdk/src/solaris/classes/sun/awt/motif/MInputMethodControl.java jdk/src/solaris/classes/sun/awt/motif/MInputMethodDescriptor.java jdk/src/solaris/classes/sun/awt/motif/MLabelPeer.java jdk/src/solaris/classes/sun/awt/motif/MListPeer.java jdk/src/solaris/classes/sun/awt/motif/MMenuBarPeer.java jdk/src/solaris/classes/sun/awt/motif/MMenuItemPeer.java jdk/src/solaris/classes/sun/awt/motif/MMenuPeer.java jdk/src/solaris/classes/sun/awt/motif/MMouseDragGestureRecognizer.java jdk/src/solaris/classes/sun/awt/motif/MPanelPeer.java jdk/src/solaris/classes/sun/awt/motif/MPopupMenuPeer.java jdk/src/solaris/classes/sun/awt/motif/MRobotPeer.java jdk/src/solaris/classes/sun/awt/motif/MScrollPanePeer.java jdk/src/solaris/classes/sun/awt/motif/MScrollbarPeer.java jdk/src/solaris/classes/sun/awt/motif/MTextAreaPeer.java jdk/src/solaris/classes/sun/awt/motif/MTextFieldPeer.java jdk/src/solaris/classes/sun/awt/motif/MWindowPeer.java jdk/src/solaris/classes/sun/awt/motif/X11Clipboard.java jdk/src/solaris/classes/sun/awt/motif/X11DragSourceContextPeer.java jdk/src/solaris/classes/sun/awt/motif/X11DropTargetContextPeer.java jdk/src/solaris/classes/sun/awt/motif/X11Selection.java jdk/src/solaris/classes/sun/awt/motif/X11SelectionHolder.java jdk/src/solaris/native/sun/awt/awt_Button.c jdk/src/solaris/native/sun/awt/awt_Canvas.c jdk/src/solaris/native/sun/awt/awt_Checkbox.c jdk/src/solaris/native/sun/awt/awt_Choice12.c jdk/src/solaris/native/sun/awt/awt_Choice21.c jdk/src/solaris/native/sun/awt/awt_Component.c jdk/src/solaris/native/sun/awt/awt_Cursor.c jdk/src/solaris/native/sun/awt/awt_DataTransferer.c jdk/src/solaris/native/sun/awt/awt_DataTransferer.h jdk/src/solaris/native/sun/awt/awt_FileDialog.c jdk/src/solaris/native/sun/awt/awt_GlobalCursorManager.c jdk/src/solaris/native/sun/awt/awt_KeyboardFocusManager.c jdk/src/solaris/native/sun/awt/awt_Label.c jdk/src/solaris/native/sun/awt/awt_List.c jdk/src/solaris/native/sun/awt/awt_Menu.c jdk/src/solaris/native/sun/awt/awt_Menu.h jdk/src/solaris/native/sun/awt/awt_MenuBar.c jdk/src/solaris/native/sun/awt/awt_MenuBar.h jdk/src/solaris/native/sun/awt/awt_MenuComponent.c jdk/src/solaris/native/sun/awt/awt_MenuItem.c jdk/src/solaris/native/sun/awt/awt_PopupMenu.c jdk/src/solaris/native/sun/awt/awt_ScrollPane.c jdk/src/solaris/native/sun/awt/awt_Scrollbar.c jdk/src/solaris/native/sun/awt/awt_Selection.c jdk/src/solaris/native/sun/awt/awt_TextArea.c jdk/src/solaris/native/sun/awt/awt_TextArea.h jdk/src/solaris/native/sun/awt/awt_TextField.c jdk/src/solaris/native/sun/awt/awt_TextField.h jdk/src/solaris/native/sun/awt/awt_TopLevel.c jdk/src/solaris/native/sun/awt/awt_XmDnD.c jdk/src/solaris/native/sun/awt/awt_XmDnD.h jdk/src/solaris/native/sun/awt/awt_dnd.c jdk/src/solaris/native/sun/awt/awt_dnd.h jdk/src/solaris/native/sun/awt/awt_dnd_ds.c jdk/src/solaris/native/sun/awt/awt_dnd_dt.c jdk/src/solaris/native/sun/awt/awt_motif.c jdk/src/solaris/native/sun/awt/awt_motif12.c jdk/src/solaris/native/sun/awt/awt_motif21.c jdk/src/solaris/native/sun/awt/awt_xembed.c jdk/src/solaris/native/sun/awt/canvas.c jdk/src/solaris/native/sun/awt/cursor.c
diffstat 369 files changed, 35796 insertions(+), 47544 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags-top-repo	Fri Sep 12 14:35:51 2008 -0700
+++ b/.hgtags-top-repo	Wed Jul 05 16:41:34 2017 +0200
@@ -9,3 +9,4 @@
 64da805be725721bf2004e7409a0d7a16fc8ddbc jdk7-b32
 bb1ef4ee3d2c8cbf43a37d372325a7952be590b9 jdk7-b33
 46a989ab932992b2084b946eeb322fa99b9fee6c jdk7-b34
+143c1abedb7d3095eff0f9ee5fec9bf48e3490fc jdk7-b35
--- a/README-builds.html	Fri Sep 12 14:35:51 2008 -0700
+++ b/README-builds.html	Wed Jul 05 16:41:34 2017 +0200
@@ -5,7 +5,7 @@
     </head>
     <body style="background-color:lightcyan">
         <!-- ====================================================== -->
-        +        <table width="100%">
+        <table width="100%">
             <tr>
                 <td align="center">
                     <img alt="OpenJDK" 
@@ -39,6 +39,11 @@
                 <li><a href="#introduction">Introduction</a></li>
                 <li><a href="#MBE">Minimum Build Environments</a></li>
                 <li><a href="#SDBE">Specific Developer Build Environments</a></li>
+                    <ul>
+                        <li><a href="#fedora">Fedora Linux</a> </li>
+                        <li><a href="#centos">CentOS Linux</a> </li>
+                        <li><a href="#ubuntu">Ubuntu Linux</a> </li>
+                    </ul>
                 <li><a href="#directories">Source Directory Structure</a> </li>
                 <li><a href="#building">Build Information</a>
                     <ul>
@@ -182,14 +187,64 @@
             we will try to provide what information we have available to us.
         </blockquote>
         <!-- ------------------------------------------------------ -->
-        <h3><a name="fedora">Fedora</a></h3>
+        <h3><a name="fedora">Fedora 9</a></h3>
         <blockquote>
-            TBD
+            After installing
+            <a href="http://www.fedoraproject.org/">Fedora 9</a>
+            you need to make sure you have
+            the "Software Development" bundle installed, plus the
+            following packages:
+            <blockquote>
+                <ul>
+                    <li>cups devel: Cups Development Package</li>
+                    <li>freetype 2.3+ devel: Freetype 2.3 Development Package</li>
+                    <li>hg: Mercurial, if you need to clone or manage source repositories</li>
+                    <li>ksh: May be needed when using <tt>webrev</tt></li>
+                </ul>
+            </blockquote>
+            <p>
+            Always a good idea to do a complete Software Update/Refresh
+            after you get all the packages installed.
         </blockquote>
         <!-- ------------------------------------------------------ -->
-        <h3><a name="debian">Debian</a></h3>
+        <h3><a name="centos">CentOS 5.2</a></h3>
         <blockquote>
-            TBD
+            After installing
+            <a href="http://www.centos.org/">CentOS 5.2</a>
+            you need to make sure you have
+            the following Development bundles installed:
+            <blockquote>
+                <ul>
+                    <li>Development Libraries</li>
+                    <li>Development Tools</li>
+                    <li>Java Development</li>
+                    <li>X Software Development</li>
+                </ul>
+            </blockquote>
+            <p>
+            Plus the following packages:
+            <blockquote>
+                <ul>
+                    <li>cups devel: Cups Development Package</li>
+                    <li>alsa devel: Alsa Development Package</li>
+                    <li>ant: Ant Package</li>
+                    <li>Xi devel: libXi.so Development Package</li>
+                </ul>
+            </blockquote>
+            <p>
+            The freetype 2.3 packages don't seem to be available,
+            but the freetype 2.3 sources can be downloaded, built,
+            and installed easily enough from
+            <a href="http://downloads.sourceforge.net/freetype">
+            the freetype site</a>.
+            Build and install with something like:
+            <blockquote>
+                <tt>./configure && make && sudo -u root make install</tt>
+            </blockquote>
+            <p>
+            Mercurial packages could not be found easily, but a Google
+            search should find ones, and they usually include Python if
+            it's needed.
         </blockquote>
         <!-- ------------------------------------------------------ -->
         <h3><a name="ubuntu">Ubuntu</a></h3>
@@ -664,8 +719,8 @@
                 </li>
                 <li>
                     Install the
-                    <a href="#msvc">Microsoft Visual Studio .NET 2003 Professional</a> or the 
-                    <a href="#mssdk">Microsoft Platform SDK</a>.
+                    <a href="#msvc">Microsoft Visual Studio .NET 2003 Professional</a> (32bit) or the 
+                    <a href="#mssdk">Microsoft Platform SDK</a> (64bit).
                 </li>
                 <li>
                     Setup all environment variables for compilers 
@@ -871,6 +926,11 @@
                     The Microsoft Visual Studio .NET 2005 (VS2005) compiler
                     will not work at this time due to the new runtime dll
                     and the manifest requirements.
+                    <p>
+                    <b>WARNING:</b> Make sure you check out the
+                    <a href="#cygwin">CYGWIN link.exe WARNING</a>.
+                    The path <tt>/usr/bin</tt> must be after the path to the
+                    Visual Studio product.
                 </blockquote>
                 <strong><a name="mssdk">Windows X64: Microsoft Platform SDK April 2005</a></strong>
                 <blockquote>
@@ -1079,6 +1139,7 @@
                         <thead>
                             <tr>
                                 <td>Binary Name</td>
+                                <td>Category</td>
                                 <td>Package</td>
                                 <td>Description</td>
                             </tr>
@@ -1087,50 +1148,59 @@
                             <tr>
                                 <td>ar.exe</td>
                                 <td>Devel</td>
-                                <td>binutils: The GNU assembler, linker and binary
+                                <td>binutils</td>
+                                <td>The GNU assembler, linker and binary
                                 utilities</td>
                             </tr>
                             <tr>
                                 <td>make.exe</td>
                                 <td>Devel</td>
-                                <td>make: The GNU version of the 'make' utility<br>
+                                <td>make</td>
+                                <td>The GNU version of the 'make' utility built for CYGWIN.<br>
                                 <b>NOTE</b>: See <a href="#gmake">the GNU make section</a></td>
                             </tr>
                             <tr>
                                 <td>m4.exe</td>
                                 <td>Interpreters</td>
-                                <td>m4: GNU implementation of the traditional Unix macro
+                                <td>m4</td>
+                                <td>GNU implementation of the traditional Unix macro
                                 processor</td>
                             </tr>
                             <tr>
                                 <td>cpio.exe</td>
                                 <td>Utils</td>
-                                <td>cpio: A program to manage archives of files</td>
+                                <td>cpio</td>
+                                <td>A program to manage archives of files</td>
                             </tr>
                             <tr>
                                 <td>gawk.exe</td>
                                 <td>Utils</td>
-                                <td>awk: Pattern-directed scanning and processing language</td>
+                                <td>awk</td>
+                                <td>Pattern-directed scanning and processing language</td>
                             </tr>
                             <tr>
                                 <td>file.exe</td>
                                 <td>Utils</td>
-                                <td>file: Determines file type using 'magic' numbers</td>
+                                <td>file</td>
+                                <td>Determines file type using 'magic' numbers</td>
                             </tr>
                             <tr>
                                 <td>zip.exe</td>
                                 <td>Archive</td>
-                                <td>zip: Package and compress (archive) files</td>
+                                <td>zip</td>
+                                <td>Package and compress (archive) files</td>
                             </tr>
                             <tr>
                                 <td>unzip.exe</td>
                                 <td>Archive</td>
-                                <td>unzip: Extract compressed files in a ZIP archive</td>
+                                <td>unzip</td>
+                                <td>Extract compressed files in a ZIP archive</td>
                             </tr>
                             <tr>
                                 <td>free.exe</td>
-                                <td>Procps</td>
-                                <td>free: Display amount of free and used memory in the system</td>
+                                <td>System</td>
+                                <td>procps</td>
+                                <td>Display amount of free and used memory in the system</td>
                             </tr>
                         </tbody>
                     </table>
@@ -1144,6 +1214,13 @@
                 section on
                 <a href="http://cygwin.com/faq/faq.using.html#faq.using.bloda" target="_blank">
                 BLODA (applications that interfere with CYGWIN)</a>.
+                <p>
+                <b>WARNING:</b>
+                Be very careful with <b><tt>link.exe</tt></b>, it will conflict
+                with the Visual Studio version. You need the Visual Studio
+                version of <tt>link.exe</tt>, not the CYGWIN one.
+                So it's important that the Visual Studio paths in PATH preceed
+                the CYGWIN path <tt>/usr/bin</tt>.
             </blockquote>
             <strong><a name="dxsdk">Microsoft DirectX 9.0 SDK header files and libraries</a></strong>
             <blockquote>
@@ -1429,7 +1506,7 @@
                     build output is to go.
                     The default output directory will be build/<i>platform</i>.
                 </dd>
-                <dt><a name="ALT_SLASHJAVA"><tt>ALT_SLASHJAVA</tt></a></dt>
+                <dt><a name="ALT_SLASH_JAVA"><tt>ALT_SLASH_JAVA</tt></a></dt>
                 <dd>
                     The default root location for many of the ALT path locations
                     of the following ALT variables.
--- a/corba/.hgtags	Fri Sep 12 14:35:51 2008 -0700
+++ b/corba/.hgtags	Wed Jul 05 16:41:34 2017 +0200
@@ -9,3 +9,4 @@
 80a0f46a6203e727012bd579fe38a609b83decce jdk7-b32
 6a5b9d2f8b20de54e3bfe33cd12bd0793caedc4e jdk7-b33
 0a812b9824e5d17b073765d1505594b49ff88a10 jdk7-b34
+3867c4d14a5bfdbb37c97b4874ccb0ee5343111c jdk7-b35
--- a/corba/make/common/shared/Defs-utils.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/corba/make/common/shared/Defs-utils.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -67,16 +67,6 @@
   UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH)
 endif
 
-# Utilities ant and findbugs
-ifndef ANT_HOME
-  ANT_HOME = $(JDK_DEVTOOLS_DIR)/share/ant/latest
-endif
-ANT = $(ANT_HOME)/bin/ant
-ifndef FINDBUGS_HOME
-  FINDBUGS_HOME = $(JDK_DEVTOOLS_DIR)/share/findbugs/latest
-endif
-FINDBUGS = $(FINDBUGS_HOME)/bin/findbugs
-
 # Utilities
 ADB            = $(UTILS_COMMAND_PATH)adb
 AR             = $(UTILS_CCS_BIN_PATH)ar
--- a/corba/make/jprt.config	Fri Sep 12 14:35:51 2008 -0700
+++ b/corba/make/jprt.config	Wed Jul 05 16:41:34 2017 +0200
@@ -93,23 +93,13 @@
 jdk_devtools="${slashjava}/devtools"
 share="${jdk_devtools}/share"
 
-# Needed for langtools, maybe other parts of the build
-ANT_HOME="${share}/ant/latest"
-export ANT_HOME
-FINDBUGS_HOME="${share}/findbugs/latest"
-export FINDBUGS_HOME
-
 # The 3 bin directories in common to all platforms
 sharebin="${share}/bin"
-antbin="${ANT_HOME}/bin"
-findbugsbin="${FINDBUGS_HOME}/bin"
 
 # Check input
 dirMustExist "${bootdir}"         ALT_BOOTDIR
 dirMustExist "${slashjava}"       ALT_SLASH_JAVA
 dirMustExist "${jdk_import}"      ALT_JDK_IMPORT_PATH
-dirMustExist "${ANT_HOME}"        ANT_HOME
-dirMustExist "${FINDBUGS_HOME}"   FINDBUGS_HOME
 
 # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
 osname=`uname -s`
@@ -133,7 +123,7 @@
     ALT_COMPILER_PATH="${compiler_path}"
     export ALT_COMPILER_PATH
     dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    path4sdk=${compiler_path}:${sharebin}:${antbin}:${findbugsbin}
+    path4sdk=${compiler_path}:${sharebin}
 
     # Add basic solaris system paths
     path4sdk=${path4sdk}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
@@ -170,7 +160,7 @@
     ALT_COMPILER_PATH="${compiler_path}"
     export ALT_COMPILER_PATH
     dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    path4sdk=${compiler_path}:${sharebin}:${antbin}:${findbugsbin}
+    path4sdk=${compiler_path}:${sharebin}
     
     # Add basic paths
     path4sdk=${path4sdk}:/usr/bin:/bin:/usr/sbin:/sbin
@@ -211,7 +201,7 @@
 	dosname="${mkshome}/mksnt/dosname -s"
         # Most unix utilities are in the mksnt directory of ROOTDIR
         unixcommand_path="${mkshome}/mksnt"
-        path4sdk="${sharebin};${antbin};${findbugsbin};${unixcommand_path}"
+        path4sdk="${sharebin};${unixcommand_path}"
         dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
 	devtools_path="${jdk_devtools}/win32/bin"
 	path4sdk="${devtools_path};${path4sdk}"
@@ -229,7 +219,7 @@
 	dosname="/usr/bin/cygpath -a -m -s"
         # Most unix utilities are in the /usr/bin
         unixcommand_path="/usr/bin"
-        path4sdk="${sharebin};${antbin};${findbugsbin};${unixcommand_path}"
+        path4sdk="${sharebin};${unixcommand_path}"
         dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
         # Find GNU make
         make="${unixcommand_path}/make.exe"
--- a/hotspot/.hgtags	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/.hgtags	Wed Jul 05 16:41:34 2017 +0200
@@ -9,3 +9,4 @@
 b727c32788a906c04839516ae7443a085185a300 jdk7-b32
 585535ec8a14adafa6bfea65d6975e29094c8cec jdk7-b33
 5251a9cd8eb8743eee647365bee1c8afdc131556 jdk7-b34
+5fa96a5a7e76da7c8dad12486293a0456c2c116c jdk7-b35
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/Location.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/Location.java	Wed Jul 05 16:41:34 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,9 +39,9 @@
     <P> Encoding: </P>
     <PRE>
     bits:
-    Where:  [15]
-    Type:   [14..12]
-    Offset: [11..0]
+    Type:   [3..0]
+    Where:  [4]
+    Offset: [31..5]
     </PRE>
 */
 
@@ -69,6 +69,7 @@
     // Location::Type constants
     TYPE_NORMAL = db.lookupIntConstant("Location::normal").intValue();
     TYPE_OOP = db.lookupIntConstant("Location::oop").intValue();
+    TYPE_NARROWOOP = db.lookupIntConstant("Location::narrowoop").intValue();
     TYPE_INT_IN_LONG = db.lookupIntConstant("Location::int_in_long").intValue();
     TYPE_LNG = db.lookupIntConstant("Location::lng").intValue();
     TYPE_FLOAT_IN_DBL = db.lookupIntConstant("Location::float_in_dbl").intValue();
@@ -115,6 +116,8 @@
     public static final Type NORMAL       = new Type("normal");
     /** Oop (please GC me!) */
     public static final Type OOP          = new Type("oop");
+    /** NarrowOop (please GC me!) */
+    public static final Type NARROWOOP    = new Type("narrowoop");
     /** Long held in one register */
     public static final Type INT_IN_LONG  = new Type("int_in_long");
     /** Long held in one register */
@@ -142,6 +145,8 @@
         return TYPE_NORMAL;
       } else if (this == OOP) {
         return TYPE_OOP;
+      } else if (this == NARROWOOP) {
+        return TYPE_NARROWOOP;
       } else if (this == INT_IN_LONG) {
         return TYPE_INT_IN_LONG;
       } else if (this == LNG) {
@@ -170,6 +175,7 @@
   // constants in Type enum
   private static int TYPE_NORMAL;
   private static int TYPE_OOP;
+  private static int TYPE_NARROWOOP;
   private static int TYPE_INT_IN_LONG;
   private static int TYPE_LNG;
   private static int TYPE_FLOAT_IN_DBL;
@@ -185,7 +191,7 @@
   Location(Where where, Type type, int offset) {
     setWhere(where);
     setType(type);
-    setOffset(offset & 0x0000FFFF);
+    setOffset(offset);
   }
 
   public Where getWhere() {
@@ -205,6 +211,8 @@
        return Type.NORMAL;
     } else if (type == TYPE_OOP) {
        return Type.OOP;
+    } else if (type == TYPE_NARROWOOP) {
+       return Type.NARROWOOP;
     } else if (type == TYPE_INT_IN_LONG) {
        return Type.INT_IN_LONG;
     } else if (type == TYPE_LNG) {
@@ -238,6 +246,10 @@
     return getType() == Type.OOP;
   }
 
+  public boolean holdsNarrowOop() {
+    return getType() == Type.NARROWOOP;
+  }
+
   public boolean holdsInt() {
     return getType() == Type.INT_IN_LONG;
   }
@@ -266,7 +278,7 @@
     if (Assert.ASSERTS_ENABLED) {
       Assert.that(getWhere() == Where.ON_STACK, "wrong Where");
     }
-    return getOffset() << VM.getVM().getLogAddressSize();
+    return getOffset() * (int)VM.getVM().getIntSize();
   }
 
   public int getRegisterNumber() {
@@ -296,6 +308,8 @@
       if (type == Type.NORMAL) {
       } else if (type == Type.OOP) {
         tty.print(",oop");
+      } else if (type == Type.NARROWOOP) {
+        tty.print(",narrowoop");
       } else if (type == Type.INT_IN_LONG) {
         tty.print(",int");
       } else if (type == Type.LNG) {
@@ -314,26 +328,26 @@
 
   /** Serialization of debugging information */
   public Location(DebugInfoReadStream stream) {
-    value = (0x0000FFFF & stream.readInt());
+    value = stream.readInt();
   }
 
   // FIXME: not yet implementable
   // void write_on(DebugInfoWriteStream* stream);
 
 
-  //--------------------------------------------------------------------------------
+  //-----------------------------------------------------------------------------
   // Internals only below this point
   //
 
   private void setWhere(Where where) {
-    value |= (where.getValue() << WHERE_SHIFT);
+    value |= ((where.getValue() << WHERE_SHIFT) & WHERE_MASK);
   }
 
   private void setType(Type type) {
-    value |= (type.getValue() << TYPE_SHIFT);
+    value |= ((type.getValue() << TYPE_SHIFT) & TYPE_MASK);
   }
 
   private void setOffset(int offset) {
-    value |= (offset << OFFSET_SHIFT);
+    value |= ((offset << OFFSET_SHIFT) & OFFSET_MASK);
   }
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java	Wed Jul 05 16:41:34 2017 +0200
@@ -206,6 +206,16 @@
           Assert.that( loc.isRegister(), "ints always saved to stack in 1 word" );
         }
         return new StackValue(valueAddr.getJLongAt(0) & 0xFFFFFFFF);
+      } else if (loc.holdsNarrowOop()) {  // Holds an narrow oop?
+        if (loc.isRegister() && VM.getVM().isBigEndian()) {
+          // The callee has no clue whether the register holds an narrow oop,
+          // long or is unused.  He always saves a long.  Here we know
+          // a long was saved, but we only want an narrow oop back.  Narrow the
+          // saved long to the narrow oop that the JVM wants.
+          return new StackValue(valueAddr.getCompOopHandleAt(VM.getVM().getIntSize()));
+        } else {
+          return new StackValue(valueAddr.getCompOopHandleAt(0));
+        }
       } else if( loc.holdsOop() ) {  // Holds an oop?
         return new StackValue(valueAddr.getOopHandleAt(0));
       } else if( loc.holdsDouble() ) {
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Wed Jul 05 16:41:34 2017 +0200
@@ -621,6 +621,11 @@
     return bytes;
   }
 
+  /** Returns true if this is a isBigEndian, false otherwise */
+  public boolean isBigEndian() {
+    return isBigEndian;
+  }
+
   /** Returns true if this is a "core" build, false if either C1 or C2
       is present */
   public boolean isCore() {
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java	Wed Jul 05 16:41:34 2017 +0200
@@ -1135,6 +1135,8 @@
             buf.append("normal");
          } else if (type == Location.Type.OOP) {
             buf.append("oop");
+         } else if (type == Location.Type.NARROWOOP) {
+            buf.append("narrowoop");
          } else if (type == Location.Type.INT_IN_LONG) {
             buf.append("int");
          } else if (type == Location.Type.LNG) {
--- a/hotspot/make/hotspot_version	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/make/hotspot_version	Wed Jul 05 16:41:34 2017 +0200
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=14
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=04
+HS_BUILD_NUMBER=05
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=7
--- a/hotspot/make/jprt.properties	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/make/jprt.properties	Wed Jul 05 16:41:34 2017 +0200
@@ -295,3 +295,9 @@
   ${jprt.my.windows.i586.test.targets}, \
   ${jprt.my.windows.x64.test.targets}
 
+# The default test/Makefile targets that should be run
+
+# Example:
+#   jprt.make.rule.test.targets=*-*-*-packtest
+#jprt.make.rule.test.targets=*-product-*-packtest
+
--- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -1129,8 +1129,8 @@
 #else
     __ pushl(frame_map()->address_for_slot(src ->double_stack_ix(), 0));
     // push and pop the part at src + wordSize, adding wordSize for the previous push
-    __ pushl(frame_map()->address_for_slot(src ->double_stack_ix(), wordSize));
-    __ popl (frame_map()->address_for_slot(dest->double_stack_ix(), wordSize));
+    __ pushl(frame_map()->address_for_slot(src ->double_stack_ix(), 2 * wordSize));
+    __ popl (frame_map()->address_for_slot(dest->double_stack_ix(), 2 * wordSize));
     __ popl (frame_map()->address_for_slot(dest->double_stack_ix(), 0));
 #endif // _LP64
 
--- a/hotspot/src/share/vm/code/location.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/code/location.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 #include "incls/_location.cpp.incl"
 
 void Location::print_on(outputStream* st) const {
-  if(type() == invalid && !legal_offset_in_bytes(offset() * BytesPerInt)) {
+  if(type() == invalid) {
     // product of Location::invalid_loc() or Location::Location().
     switch (where()) {
     case on_stack:     st->print("empty");    break;
@@ -42,6 +42,7 @@
   switch (type()) {
   case normal:                                 break;
   case oop:          st->print(",oop");        break;
+  case narrowoop:    st->print(",narrowoop");  break;
   case int_in_long:  st->print(",int");        break;
   case lng:          st->print(",long");       break;
   case float_in_dbl: st->print(",float");      break;
@@ -53,17 +54,17 @@
 
 
 Location::Location(DebugInfoReadStream* stream) {
-  _value = (uint16_t) stream->read_int();
+  _value = (juint) stream->read_int();
 }
 
 
 void Location::write_on(DebugInfoWriteStream* stream) {
-  stream->write_int(_value & 0x0000FFFF);
+  stream->write_int(_value);
 }
 
 
 // Valid argument to Location::new_stk_loc()?
 bool Location::legal_offset_in_bytes(int offset_in_bytes) {
   if ((offset_in_bytes % BytesPerInt) != 0)  return false;
-  return (offset_in_bytes / BytesPerInt) < (OFFSET_MASK >> OFFSET_SHIFT);
+  return (juint)(offset_in_bytes / BytesPerInt) < (OFFSET_MASK >> OFFSET_SHIFT);
 }
--- a/hotspot/src/share/vm/code/location.hpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/code/location.hpp	Wed Jul 05 16:41:34 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,10 +28,10 @@
 //
 // Encoding:
 //
-// bits:
-//  Where:  [15]
-//  Type:   [14..12]
-//  Offset: [11..0]
+// bits (use low bits for best compression):
+//  Type:   [3..0]
+//  Where:  [4]
+//  Offset: [31..5]
 
 class Location VALUE_OBJ_CLASS_SPEC {
   friend class VMStructs;
@@ -42,6 +42,7 @@
   };
 
   enum Type {
+    invalid,                    // Invalid location
     normal,                     // Ints, floats, double halves
     oop,                        // Oop (please GC me!)
     int_in_long,                // Integer held in long register
@@ -49,21 +50,21 @@
     float_in_dbl,               // Float held in double register
     dbl,                        // Double held in one register
     addr,                       // JSR return address
-    invalid                     // Invalid location
+    narrowoop                   // Narrow Oop (please GC me!)
   };
 
 
  private:
   enum {
-    OFFSET_MASK  = (jchar) 0x0FFF,
-    OFFSET_SHIFT = 0,
-    TYPE_MASK    = (jchar) 0x7000,
-    TYPE_SHIFT   = 12,
-    WHERE_MASK   = (jchar) 0x8000,
-    WHERE_SHIFT  = 15
+    TYPE_MASK    = (juint) 0x0F,
+    TYPE_SHIFT   = 0,
+    WHERE_MASK   = (juint) 0x10,
+    WHERE_SHIFT  = 4,
+    OFFSET_MASK  = (juint) 0xFFFFFFE0,
+    OFFSET_SHIFT = 5
   };
 
-  uint16_t _value;
+  juint _value;
 
   // Create a bit-packed Location
   Location(Where where_, Type type_, unsigned offset_) {
@@ -74,9 +75,9 @@
   }
 
   inline void set(Where where_, Type type_, unsigned offset_) {
-    _value = (uint16_t) ((where_  << WHERE_SHIFT) |
-                         (type_   << TYPE_SHIFT)  |
-                         ((offset_ << OFFSET_SHIFT) & OFFSET_MASK));
+    _value = (juint) ((where_  << WHERE_SHIFT) |
+                      (type_   << TYPE_SHIFT)  |
+                      ((offset_ << OFFSET_SHIFT) & OFFSET_MASK));
   }
 
  public:
@@ -86,7 +87,7 @@
   // Register location Factory
   static Location new_reg_loc( Type t, VMReg reg ) { return Location(in_register, t, reg->value()); }
   // Default constructor
-  Location() { set(on_stack,invalid,(unsigned) -1); }
+  Location() { set(on_stack,invalid,0); }
 
   // Bit field accessors
   Where where()  const { return (Where)       ((_value & WHERE_MASK)  >> WHERE_SHIFT);}
--- a/hotspot/src/share/vm/opto/addnode.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/opto/addnode.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -157,6 +157,7 @@
     Node *a12 = add1->in(2);
     const Type *t12 = phase->type( a12 );
     if( t12->singleton() && t12 != Type::TOP && (add1 != add1->in(1)) ) {
+      assert(add1->in(1) != this, "dead loop in AddNode::Ideal");
       add2 = add1->clone();
       add2->set_req(2, in(2));
       add2 = phase->transform(add2);
@@ -173,6 +174,7 @@
     Node *a22 = add2->in(2);
     const Type *t22 = phase->type( a22 );
     if( t22->singleton() && t22 != Type::TOP && (add2 != add2->in(1)) ) {
+      assert(add2->in(1) != this, "dead loop in AddNode::Ideal");
       Node *addx = add2->clone();
       addx->set_req(1, in(1));
       addx->set_req(2, add2->in(1));
--- a/hotspot/src/share/vm/opto/callnode.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/opto/callnode.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -334,6 +334,9 @@
     case Type::InstPtr:
       st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->isa_oopptr()->const_oop());
       break;
+    case Type::NarrowOop:
+      st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_oopptr()->const_oop());
+      break;
     case Type::RawPtr:
       st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,t->is_rawptr());
       break;
--- a/hotspot/src/share/vm/opto/compile.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/opto/compile.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -1967,6 +1967,7 @@
           !n->is_Proj() &&
           nop != Op_CreateEx &&
           nop != Op_CheckCastPP &&
+          nop != Op_DecodeN &&
           !n->is_Mem() ) {
         Node *x = n->clone();
         call->set_req( TypeFunc::Parms, x );
@@ -2075,20 +2076,27 @@
   case Op_CmpP:
     // Do this transformation here to preserve CmpPNode::sub() and
     // other TypePtr related Ideal optimizations (for example, ptr nullness).
-    if( n->in(1)->is_DecodeN() ) {
+    if (n->in(1)->is_DecodeN() || n->in(2)->is_DecodeN()) {
+      Node* in1 = n->in(1);
+      Node* in2 = n->in(2);
+      if (!in1->is_DecodeN()) {
+        in2 = in1;
+        in1 = n->in(2);
+      }
+      assert(in1->is_DecodeN(), "sanity");
+
       Compile* C = Compile::current();
-      Node* in2 = NULL;
-      if( n->in(2)->is_DecodeN() ) {
-        in2 = n->in(2)->in(1);
-      } else if ( n->in(2)->Opcode() == Op_ConP ) {
-        const Type* t = n->in(2)->bottom_type();
-        if (t == TypePtr::NULL_PTR) {
-          Node *in1 = n->in(1);
+      Node* new_in2 = NULL;
+      if (in2->is_DecodeN()) {
+        new_in2 = in2->in(1);
+      } else if (in2->Opcode() == Op_ConP) {
+        const Type* t = in2->bottom_type();
+        if (t == TypePtr::NULL_PTR && UseImplicitNullCheckForNarrowOop) {
           if (Matcher::clone_shift_expressions) {
             // x86, ARM and friends can handle 2 adds in addressing mode.
             // Decode a narrow oop and do implicit NULL check in address
             // [R12 + narrow_oop_reg<<3 + offset]
-            in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR);
+            new_in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR);
           } else {
             // Don't replace CmpP(o ,null) if 'o' is used in AddP
             // to generate implicit NULL check on Sparc where
@@ -2099,16 +2107,22 @@
                 break;
             }
             if (i >= in1->outcnt()) {
-              in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR);
+              new_in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR);
             }
           }
         } else if (t->isa_oopptr()) {
-          in2 = ConNode::make(C, t->make_narrowoop());
+          new_in2 = ConNode::make(C, t->make_narrowoop());
         }
       }
-      if( in2 != NULL ) {
-        Node* cmpN = new (C, 3) CmpNNode(n->in(1)->in(1), in2);
+      if (new_in2 != NULL) {
+        Node* cmpN = new (C, 3) CmpNNode(in1->in(1), new_in2);
         n->subsume_by( cmpN );
+        if (in1->outcnt() == 0) {
+          in1->disconnect_inputs(NULL);
+        }
+        if (in2->outcnt() == 0) {
+          in2->disconnect_inputs(NULL);
+        }
       }
     }
     break;
@@ -2214,6 +2228,9 @@
 // Replacing Opaque nodes with their input in final_graph_reshaping_impl(),
 // requires that the walk visits a node's inputs before visiting the node.
 static void final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_Reshape_Counts &fpu ) {
+  ResourceArea *area = Thread::current()->resource_area();
+  Unique_Node_List sfpt(area);
+
   fpu._visited.set(root->_idx); // first, mark node as visited
   uint cnt = root->req();
   Node *n = root;
@@ -2224,6 +2241,8 @@
       Node* m = n->in(i);
       ++i;
       if (m != NULL && !fpu._visited.test_set(m->_idx)) {
+        if (m->is_SafePoint() && m->as_SafePoint()->jvms() != NULL)
+          sfpt.push(m);
         cnt = m->req();
         nstack.push(n, i); // put on stack parent and next input's index
         n = m;
@@ -2240,6 +2259,41 @@
       nstack.pop();        // Shift to the next node on stack
     }
   }
+
+  // Go over safepoints nodes to skip DecodeN nodes for debug edges.
+  // It could be done for an uncommon traps or any safepoints/calls
+  // if the DecodeN node is referenced only in a debug info.
+  while (sfpt.size() > 0) {
+    n = sfpt.pop();
+    JVMState *jvms = n->as_SafePoint()->jvms();
+    assert(jvms != NULL, "sanity");
+    int start = jvms->debug_start();
+    int end   = n->req();
+    bool is_uncommon = (n->is_CallStaticJava() &&
+                        n->as_CallStaticJava()->uncommon_trap_request() != 0);
+    for (int j = start; j < end; j++) {
+      Node* in = n->in(j);
+      if (in->is_DecodeN()) {
+        bool safe_to_skip = true;
+        if (!is_uncommon ) {
+          // Is it safe to skip?
+          for (uint i = 0; i < in->outcnt(); i++) {
+            Node* u = in->raw_out(i);
+            if (!u->is_SafePoint() ||
+                 u->is_Call() && u->as_Call()->has_non_debug_use(n)) {
+              safe_to_skip = false;
+            }
+          }
+        }
+        if (safe_to_skip) {
+          n->set_req(j, in->in(1));
+        }
+        if (in->outcnt() == 0) {
+          in->disconnect_inputs(NULL);
+        }
+      }
+    }
+  }
 }
 
 //------------------------------final_graph_reshaping--------------------------
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -1212,6 +1212,7 @@
                     Deoptimization::Action_make_not_entrant,
                     NULL, "assert_null");
     } else {
+      replace_in_map(value, zerocon(type));
       builtin_throw(reason);
     }
   }
@@ -1960,6 +1961,7 @@
     // method will be compiled to handle NULLs.
     PreserveJVMState pjvms(this);
     set_control(*null_control);
+    replace_in_map(value, null());
     uncommon_trap(Deoptimization::Reason_null_check,
                   Deoptimization::Action_make_not_entrant);
     (*null_control) = top();    // NULL path is dead
--- a/hotspot/src/share/vm/opto/lcm.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/opto/lcm.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -58,6 +58,9 @@
     not_null_block = _succs[0];
     null_block     = _succs[1];
   }
+  while (null_block->is_Empty() == Block::empty_with_goto) {
+    null_block     = null_block->_succs[0];
+  }
 
   // Search the exception block for an uncommon trap.
   // (See Parse::do_if and Parse::do_ifnull for the reason
@@ -149,6 +152,10 @@
       const TypePtr *adr_type = NULL;  // Do not need this return value here
       const Node* base = mach->get_base_and_disp(offset, adr_type);
       if (base == NULL || base == NodeSentinel) {
+        // Narrow oop address doesn't have base, only index
+        if( val->bottom_type()->isa_narrowoop() &&
+            MacroAssembler::needs_explicit_null_check(offset) )
+          continue;             // Give up if offset is beyond page size
         // cannot reason about it; is probably not implicit null exception
       } else {
         const TypePtr* tptr = base->bottom_type()->is_ptr();
--- a/hotspot/src/share/vm/opto/loopopts.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/opto/loopopts.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -932,7 +932,7 @@
             // to fold a StoreP and an AddP together (as part of an
             // address expression) and the AddP and StoreP have
             // different controls.
-            if( !x->is_Load() ) _igvn._worklist.yank(x);
+            if( !x->is_Load() && !x->is_DecodeN() ) _igvn._worklist.yank(x);
           }
           _igvn.remove_dead_node(n);
         }
--- a/hotspot/src/share/vm/opto/output.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/opto/output.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -685,6 +685,8 @@
     } else if( t->base() == Type::Int && OptoReg::is_reg(regnum) ) {
       array->append(new_loc_value( _regalloc, regnum, Matcher::int_in_long
                                    ? Location::int_in_long : Location::normal ));
+    } else if( t->base() == Type::NarrowOop ) {
+      array->append(new_loc_value( _regalloc, regnum, Location::narrowoop ));
     } else {
       array->append(new_loc_value( _regalloc, regnum, _regalloc->is_oop(local) ? Location::oop : Location::normal ));
     }
@@ -704,6 +706,13 @@
   case Type::KlassPtr:          // fall through
     array->append(new ConstantOopWriteValue(t->isa_oopptr()->const_oop()->encoding()));
     break;
+  case Type::NarrowOop:
+    if (t == TypeNarrowOop::NULL_PTR) {
+      array->append(new ConstantOopWriteValue(NULL));
+    } else {
+      array->append(new ConstantOopWriteValue(t->make_ptr()->isa_oopptr()->const_oop()->encoding()));
+    }
+    break;
   case Type::Int:
     array->append(new ConstantIntValue(t->is_int()->get_con()));
     break;
@@ -878,9 +887,14 @@
         }
       } else if( !obj_node->is_Con() ) {
         OptoReg::Name obj_reg = _regalloc->get_reg_first(obj_node);
-        scval = new_loc_value( _regalloc, obj_reg, Location::oop );
+        if( obj_node->bottom_type()->base() == Type::NarrowOop ) {
+          scval = new_loc_value( _regalloc, obj_reg, Location::narrowoop );
+        } else {
+          scval = new_loc_value( _regalloc, obj_reg, Location::oop );
+        }
       } else {
-        scval = new ConstantOopWriteValue(obj_node->bottom_type()->is_instptr()->const_oop()->encoding());
+        const TypePtr *tp = obj_node->bottom_type()->make_ptr();
+        scval = new ConstantOopWriteValue(tp->is_instptr()->const_oop()->encoding());
       }
 
       OptoReg::Name box_reg = BoxLockNode::stack_slot(box_node);
--- a/hotspot/src/share/vm/opto/reg_split.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/opto/reg_split.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -527,6 +527,7 @@
       // Initialize needs_phi and needs_split
       bool needs_phi = false;
       bool needs_split = false;
+      bool has_phi = false;
       // Walk the predecessor blocks to check inputs for that live range
       // Grab predecessor block header
       n1 = b->pred(1);
@@ -570,28 +571,30 @@
         }
       }  // End for all potential Phi inputs
 
-      // If a phi is needed, check for it
-      if( needs_phi ) {
-        // check block for appropriate phinode & update edges
-        for( insidx = 1; insidx <= b->end_idx(); insidx++ ) {
-          n1 = b->_nodes[insidx];
-          // bail if this is not a phi
-          phi = n1->is_Phi() ? n1->as_Phi() : NULL;
-          if( phi == NULL ) {
-            // Keep track of index of first non-PhiNode instruction in block
-            non_phi = insidx;
-            // break out of the for loop as we have handled all phi nodes
-            break;
-          }
-          // must be looking at a phi
-          if( Find_id(n1) == lidxs.at(slidx) ) {
-            // found the necessary phi
-            needs_phi = false;
-            // initialize the Reaches entry for this LRG
-            Reachblock[slidx] = phi;
-            break;
-          }  // end if found correct phi
-        }  // end for all phi's
+      // check block for appropriate phinode & update edges
+      for( insidx = 1; insidx <= b->end_idx(); insidx++ ) {
+        n1 = b->_nodes[insidx];
+        // bail if this is not a phi
+        phi = n1->is_Phi() ? n1->as_Phi() : NULL;
+        if( phi == NULL ) {
+          // Keep track of index of first non-PhiNode instruction in block
+          non_phi = insidx;
+          // break out of the for loop as we have handled all phi nodes
+          break;
+        }
+        // must be looking at a phi
+        if( Find_id(n1) == lidxs.at(slidx) ) {
+          // found the necessary phi
+          needs_phi = false;
+          has_phi = true;
+          // initialize the Reaches entry for this LRG
+          Reachblock[slidx] = phi;
+          break;
+        }  // end if found correct phi
+      }  // end for all phi's
+
+      // If a phi is needed or exist, check for it
+      if( needs_phi || has_phi ) {
         // add new phinode if one not already found
         if( needs_phi ) {
           // create a new phi node and insert it into the block
@@ -695,7 +698,8 @@
               }
             }
             assert( u, "at least 1 valid input expected" );
-            if( i >= cnt ) {    // Didn't find 2+ unique inputs?
+            if( i >= cnt ) {    // Found one unique input
+              assert(Find_id(n) == Find_id(u), "should be the same lrg");
               n->replace_by(u); // Then replace with unique input
               n->disconnect_inputs(NULL);
               b->_nodes.remove(insidx);
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -1204,15 +1204,17 @@
       // Turn off until bug is fixed.
       // FLAG_SET_ERGO(bool, UseCompressedOops, true);
     }
+#ifdef _WIN64
+    if (UseLargePages && UseCompressedOops) {
+      // Cannot allocate guard pages for implicit checks in indexed addressing
+      // mode, when large pages are specified on windows.
+      FLAG_SET_DEFAULT(UseImplicitNullCheckForNarrowOop, false);
+    }
+#endif //  _WIN64
   } else {
     if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
       // If specified, give a warning
-      if (UseConcMarkSweepGC){
-        warning("Compressed Oops does not work with CMS");
-      } else {
-        warning(
-          "Max heap size too large for Compressed Oops");
-      }
+      warning( "Max heap size too large for Compressed Oops");
       FLAG_SET_DEFAULT(UseCompressedOops, false);
     }
   }
--- a/hotspot/src/share/vm/runtime/globals.hpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Wed Jul 05 16:41:34 2017 +0200
@@ -294,6 +294,9 @@
   lp64_product(bool, CheckCompressedOops, trueInDebug,                      \
             "generate checks in encoding/decoding code")                    \
                                                                             \
+  product(bool, UseImplicitNullCheckForNarrowOop, true,                     \
+            "generate implicit null check in indexed addressing mode.")     \
+                                                                            \
   /* UseMembar is theoretically a temp flag used for memory barrier         \
    * removal testing.  It was supposed to be removed before FCS but has     \
    * been re-added (see 6401008) */                                         \
--- a/hotspot/src/share/vm/runtime/stackValue.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/runtime/stackValue.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,6 +86,22 @@
     case Location::lng:
       // Long   value in an aligned adjacent pair
       return new StackValue(*(intptr_t*)value_addr);
+    case Location::narrowoop: {
+      union { intptr_t p; narrowOop noop;} value;
+      value.p = (intptr_t) CONST64(0xDEADDEAFDEADDEAF);
+      if (loc.is_register()) {
+        // The callee has no clue whether the register holds an int,
+        // long or is unused.  He always saves a long.  Here we know
+        // a long was saved, but we only want an int back.  Narrow the
+        // saved long to the int that the JVM wants.
+        value.noop =  (narrowOop) *(julong*) value_addr;
+      } else {
+        value.noop = *(narrowOop*) value_addr;
+      }
+      // Decode narrowoop and wrap a handle around the oop
+      Handle h(oopDesc::decode_heap_oop(value.noop));
+      return new StackValue(h);
+    }
 #endif
     case Location::oop: {
       Handle h(*(oop *)value_addr); // Wrap a handle around the oop
--- a/hotspot/src/share/vm/runtime/thread.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -2756,13 +2756,17 @@
   // For now, just manually iterate through them.
   tc->do_thread(VMThread::vm_thread());
   Universe::heap()->gc_threads_do(tc);
-  {
-    // Grab the Terminator_lock to prevent watcher_thread from being terminated.
-    MutexLockerEx mu(Terminator_lock, Mutex::_no_safepoint_check_flag);
-    WatcherThread *wt = WatcherThread::watcher_thread();
-    if (wt != NULL)
-      tc->do_thread(wt);
-  }
+  WatcherThread *wt = WatcherThread::watcher_thread();
+  // Strictly speaking, the following NULL check isn't sufficient to make sure
+  // the data for WatcherThread is still valid upon being examined. However,
+  // considering that WatchThread terminates when the VM is on the way to
+  // exit at safepoint, the chance of the above is extremely small. The right
+  // way to prevent termination of WatcherThread would be to acquire
+  // Terminator_lock, but we can't do that without violating the lock rank
+  // checking in some cases.
+  if (wt != NULL)
+    tc->do_thread(wt);
+
   // If CompilerThreads ever become non-JavaThreads, add them here
 }
 
--- a/hotspot/src/share/vm/runtime/virtualspace.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/runtime/virtualspace.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -380,7 +380,8 @@
                                      bool large, char* requested_address) :
   ReservedSpace(size, alignment, large,
                 requested_address,
-                UseCompressedOops ? lcm(os::vm_page_size(), alignment) : 0) {
+                UseCompressedOops && UseImplicitNullCheckForNarrowOop ?
+                  lcm(os::vm_page_size(), alignment) : 0) {
   // Only reserved space for the java heap should have a noaccess_prefix
   // if using compressed oops.
   protect_noaccess_prefix(size);
@@ -391,7 +392,8 @@
                                      const size_t suffix_size,
                                      const size_t suffix_align) :
   ReservedSpace(prefix_size, prefix_align, suffix_size, suffix_align,
-                UseCompressedOops ? lcm(os::vm_page_size(), prefix_align) : 0) {
+                UseCompressedOops && UseImplicitNullCheckForNarrowOop ?
+                  lcm(os::vm_page_size(), prefix_align) : 0) {
   protect_noaccess_prefix(prefix_size+suffix_size);
 }
 
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Jul 05 16:41:34 2017 +0200
@@ -1577,6 +1577,7 @@
                                                                           \
   declare_constant(Location::normal)                                      \
   declare_constant(Location::oop)                                         \
+  declare_constant(Location::narrowoop)                                   \
   declare_constant(Location::int_in_long)                                 \
   declare_constant(Location::lng)                                         \
   declare_constant(Location::float_in_dbl)                                \
--- a/hotspot/test/Makefile	Fri Sep 12 14:35:51 2008 -0700
+++ b/hotspot/test/Makefile	Wed Jul 05 16:41:34 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 1995-2008 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -19,17 +19,18 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-#  
+#
 #
 
 #
-# Makefile to run jtreg
+# Makefile to run various jdk tests
 #
 
+# Get OS/ARCH specifics
 OSNAME = $(shell uname -s)
+SLASH_JAVA = /java
 ifeq ($(OSNAME), SunOS)
   PLATFORM = solaris
-  JCT_PLATFORM = solaris
   ARCH = $(shell uname -p)
   ifeq ($(ARCH), i386)
     ARCH=i586
@@ -37,203 +38,165 @@
 endif
 ifeq ($(OSNAME), Linux)
   PLATFORM = linux
-  JCT_PLATFORM = linux
   ARCH = $(shell uname -m)
   ifeq ($(ARCH), i386)
-    ARCH=i586
+    ARCH = i586
   endif
 endif
 ifeq ($(OSNAME), Windows_NT)
   PLATFORM = windows
-  JCT_PLATFORM = win32
+  SLASH_JAVA = J:
   ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
-    ARCH=ia64
+    ARCH = ia64
   else
     ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
-      ARCH=x64
+      ARCH = x64
     else
       ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
-        ARCH=x64
+        ARCH = x64
       else
-        ARCH=i586
+        ARCH = i586
       endif
     endif
   endif
+  EXESUFFIX = .exe
 endif
 
-# Default bundle of all test results (passed or not)
-JPRT_ARCHIVE_BUNDLE=$(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip
+# Utilities used
+CD    = cd
+CP    = cp
+ECHO  = echo
+MKDIR = mkdir
+ZIP   = zip
 
-# Default home for JTREG
-ifeq ($(PLATFORM), windows)
-  JT_HOME = J:/svc/jct-tools3.2.2_01
-else
-  JT_HOME = /java/svc/jct-tools3.2.2_01
+# Root of this test area (important to use full paths in some places)
+TEST_ROOT := $(shell pwd)
+
+# Root of all test results
+ABS_BUILD_ROOT = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)
+ABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput
+
+# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
+ifndef PRODUCT_HOME
+  # Try to use j2sdk-image if it exists
+  ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
+  PRODUCT_HOME :=                       \
+    $(shell                             \
+      if [ -d $(ABS_JDK_IMAGE) ] ; then \
+         $(ECHO) "$(ABS_JDK_IMAGE)";    \
+       else                             \
+         $(ECHO) "$(ABS_BUILD_ROOT)" ;  \
+       fi)
 endif
 
-# Default JTREG to run
-JTREG = $(JT_HOME)/$(JCT_PLATFORM)/bin/jtreg
+# Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
+JAVA_OPTIONS = 
+ifdef JAVA_ARGS
+  JAVA_OPTIONS = $(JAVA_ARGS)
+endif
 
-# Root of this test area
-TEST_ROOT := $(shell pwd)
+# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
+ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
+ifdef JPRT_ARCHIVE_BUNDLE
+  ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
+endif
 
-# Default JDK to test
-JAVA_HOME = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)
+# How to create the test bundle (pass or fail, we want to create this)
+BUNDLE_UP = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`     \
+	      && $(CD) $(ABS_TEST_OUTPUT_DIR)             \
+	      && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
+BUNDLE_UP_FAILED = ( exitCode=$$? && $(BUNDLE_UP) && exit $${exitCode} )
 
-# The test directories to run
-DEFAULT_TESTDIRS = serviceability
-TESTDIRS = $(DEFAULT_TESTDIRS)
+################################################################
 
-# Files that hold total passed and failed counts (passed==0 is bad)
-JTREG_TOTALS_DIR = $(TEST_ROOT)/JTREG_TOTALS_$(PLATFORM)_$(ARCH)
-JTREG_FAILED = $(JTREG_TOTALS_DIR)/failed_count
-JTREG_PASSED = $(JTREG_TOTALS_DIR)/passed_count
+# Default make rule (runs jtreg_tests)
+all: jtreg_tests
+	@$(ECHO) "Testing completed successfully"
 
-# Root of all test results
-JTREG_ALL_OUTPUT_DIRNAME = JTREG_OUTPUT_$(PLATFORM)_$(ARCH)
-JTREG_ALL_OUTPUT_DIR = $(TEST_ROOT)/$(JTREG_ALL_OUTPUT_DIRNAME)
-
-# Test results for one test directory
-JTREG_TEST_OUTPUT_DIR = $(JTREG_ALL_OUTPUT_DIR)/$@
-JTREG_TEST_REPORT_DIR = $(JTREG_TEST_OUTPUT_DIR)/JTreport
-JTREG_TEST_WORK_DIR   = $(JTREG_TEST_OUTPUT_DIR)/JTwork
-JTREG_TEST_SUMMARY    =	$(JTREG_TEST_REPORT_DIR)/summary.txt
-
-# Temp files used by this Makefile
-JTREG_TEST_TEMP_DIR   = $(JTREG_ALL_OUTPUT_DIR)/$@/temp
-JTREG_TEMP_PASSED     = $(JTREG_TEST_TEMP_DIR)/passed
-JTREG_TEMP_FAILED     = $(JTREG_TEST_TEMP_DIR)/failed
-JTREG_TEMP_OUTPUT     = $(JTREG_TEST_TEMP_DIR)/output
-JTREG_TEMP_RESULTS    = $(JTREG_TEST_TEMP_DIR)/results
-
-# JTREG options (different for 2.1.6 and 3.2.2_01)
-JTREG_COMMON_OPTIONS = -r:$(JTREG_TEST_REPORT_DIR) \
-                       -w:$(JTREG_TEST_WORK_DIR) \
-                       -testjdk:$(JAVA_HOME) \
-                       -automatic \
-	               -verbose:all
-JTREG_216_OPTIONS = $(JTREG_COMMON_OPTIONS) $@ $(JAVA_ARGS)
-JTREG_322_OPTIONS = $(JTREG_COMMON_OPTIONS) $(JAVA_ARGS:%=-vmoption:%) $@
-
-# Default make rule
-all: clean check tests
-
-# Chaeck to make sure these directories exist
-check: $(JT_HOME) $(JAVA_HOME) $(JTREG)
-
-# Prime the test run
-primecounts: FRC
-	@rm -f -r $(JTREG_TOTALS_DIR)
-	@mkdir -p $(JTREG_TOTALS_DIR)
-	@echo "0" > $(JTREG_FAILED)
-	@echo "0" > $(JTREG_PASSED)
-
-# Run the tests and determine the 'make' command exit status
-#   Ultimately we determine the make exit code based on the passed/failed count
-tests: primecounts $(TESTDIRS)
-	@echo "JTREG TOTAL: passed=`cat $(JTREG_PASSED)` failed=`cat $(JTREG_FAILED)`"
-	zip -q -r $(JPRT_ARCHIVE_BUNDLE) $(JTREG_ALL_OUTPUT_DIRNAME)
-	@if [ `cat $(JTREG_FAILED)` -ne 0 -o \
-	     `cat $(JTREG_PASSED)` -le 0 ] ; then \
-	  echo "JTREG FAILED"; \
-	  exit 1; \
-	else \
-	  echo "JTREG PASSED"; \
-	  exit 0; \
-	fi
-
-# Just make sure these directires exist
-$(JT_HOME) $(JAVA_HOME): FRC
-	@if [ ! -d $@ ] ; then \
-	    echo "ERROR: Directory $@ does not exist"; \
-	    exit 1; \
-	fi
-
-# Make sure this file exists
-$(JTREG): FRC
-	@if [ ! -f $@ ] ; then \
-	    echo "ERROR: File $@ does not exist"; \
-	    exit 1; \
-	fi
-
-# Process each test directory one by one, this rule always completes.
-#    Note that the use of 'tee' tosses the jtreg process exit status, this
-#    is as expected because even if jtreg fails, we need to save the
-#    output. So we update the JTREG_PASSED and JTREG_FAILED count files.
-#    Note that missing the 'results:' line in the last few lines of output
-#    will indicate a failure (or a bump by one of the JTREG_FAILED file.
-#    Note that passed: 0 or no passed: indication means a failure.
-#    Note that any indication of the word 'failed' indicates failure.
-#    Ultimately if the contents of JTREG_FAILED is not 0, we have failed 
-#    tests, and if the contents of JTREG_PASSED is 0, we consider that a
-#    failure.
-$(TESTDIRS):  FRC
-	@if [ ! -d $@ ] ; then \
-	    echo "ERROR: Directory $@ does not exist"; \
-	    exit 1; \
-	fi
-	@echo "---------------------------------------------------"
-	@rm -f -r $(JTREG_TEST_OUTPUT_DIR)
-	@mkdir -p $(JTREG_TEST_OUTPUT_DIR)
-	@mkdir -p $(JTREG_TEST_WORK_DIR)
-	@mkdir -p $(JTREG_TEST_WORK_DIR)/scratch
-	@mkdir -p $(JTREG_TEST_REPORT_DIR)
-	@mkdir -p $(JTREG_TEST_TEMP_DIR)
-	@echo "Testing $@"
-	@echo "Using JAVA_HOME=$(JAVA_HOME)"
-	@echo "Using JAVA_ARGS=$(JAVA_ARGS)"
-	@if [ "`$(JTREG) -help 2>&1 | fgrep -- -vmoption`" != "" ] ; then \
-	  echo "Assume we are using jtreg 3.2.2_01 or newer"; \
-	  echo "$(JTREG) $(JTREG_322_OPTIONS)"; \
-	  $(JTREG) $(JTREG_322_OPTIONS) 2>&1 | tee $(JTREG_TEMP_OUTPUT) ; \
-	else \
-	  echo "Assume we are using jtreg 2.1.6"; \
-	  echo "$(JTREG) $(JTREG_216_OPTIONS)"; \
-	  $(JTREG) $(JTREG_216_OPTIONS) 2>&1 | tee $(JTREG_TEMP_OUTPUT) ; \
-	fi
-	@echo "---------------------------------------------------"
-	@echo "Extracting passed and failed counts from jtreg output"
-	@tail -10 $(JTREG_TEMP_OUTPUT) | fgrep -i 'results:' | \
-	       tail -1 | tee $(JTREG_TEMP_RESULTS)
-	@sed -e 's@.*\ passed:\ \([1-9][0-9]*\).*@\1@' $(JTREG_TEMP_RESULTS) \
-	       > $(JTREG_TEMP_PASSED)
-	@if [ "`cat $(JTREG_TEMP_PASSED)`" = "" ] ; then \
-	  echo "ERROR: No passed indication in results"; \
-	  expr `cat $(JTREG_FAILED)` '+' 1 > $(JTREG_FAILED); \
-	elif [ `cat $(JTREG_TEMP_PASSED)` -le 0 ] ; then \
-	  echo "ERROR: Passed count appears to be 0"; \
-	  expr `cat $(JTREG_FAILED)` '+' 1 > $(JTREG_FAILED); \
-	elif [ "`fgrep -i failed $(JTREG_TEMP_RESULTS)`" = "" ] ; then \
-	  echo "No indication anything failed"; \
-	  expr `cat $(JTREG_PASSED)` '+' `cat $(JTREG_TEMP_PASSED)` \
-		> $(JTREG_PASSED); \
-	else \
-	  sed -e 's@.*\ failed:\ \([1-9][0-9]*\).*@\1@' $(JTREG_TEMP_FAILED) \
-		> $(JTREG_TEMP_FAILED); \
-	  if [ "`cat $(JTREG_TEMP_FAILED)`" = "" ] ; then \
-	    echo "ERROR: Failed pattern but no failed count in results"; \
-	    expr `cat $(JTREG_FAILED)` '+' 1 > $(JTREG_FAILED); \
-	  elif [ `cat $(JTREG_TEMP_FAILED)` -le 0 ] ; then \
-	    echo "ERROR: Failed count is 0, did something failed or not?"; \
-	    expr `cat $(JTREG_FAILED)` '+' 1 > $(JTREG_FAILED); \
-	  else \
-	    expr `cat $(JTREG_FAILED)` '+' `cat $(JTREG_TEMP_FAILED)` \
-		  > $(JTREG_FAILED); \
-	  fi; \
-	fi
-	@echo "---------------------------------------------------"
-	@echo "Summary: "
-	@if [ -f $(JTREG_TEST_SUMMARY) ] ; then \
-	  cat $(JTREG_TEST_SUMMARY) ; \
-	else \
-	  echo "ERROR: Missing $(JTREG_TEST_SUMMARY)"; \
-	fi
-	@echo "---------------------------------------------------"
+# Prep for output
+prep: clean
+	@$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
+	@$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
 
 # Cleanup
 clean:
-	rm -f -r $(JTREG_ALL_OUTPUT_DIR)
-	rm -f $(JPRT_ARCHIVE_BUNDLE)
+	$(RM) -r $(ABS_TEST_OUTPUT_DIR)
+	$(RM) $(ARCHIVE_BUNDLE)
 
-FRC:
+################################################################
 
+# jtreg tests
+
+# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
+JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
+ifdef JPRT_JTREG_HOME
+  JT_HOME = $(JPRT_JTREG_HOME)
+endif
+
+# Expect JPRT to set TESTDIRS to the jtreg test dirs
+JTREG_TESTDIRS = demo/jvmti/gctest demo/jvmti/hprof
+ifdef TESTDIRS
+  JTREG_TESTDIRS = $(TESTDIRS)
+endif
+
+# Default JTREG to run (win32 script works for everybody)
+JTREG = $(JT_HOME)/win32/bin/jtreg
+
+# Option to tell jtreg to not run tests marked with "ignore"
+ifeq ($(PLATFORM), windows)
+  JTREG_KEY_OPTION = -k:!ignore
+else
+  JTREG_KEY_OPTION = -k:\!ignore
+endif
+
+#EXTRA_JTREG_OPTIONS =
+
+jtreg_tests: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
+	$(JTREG) -a -v:fail,error               \
+          $(JTREG_KEY_OPTION)                   \
+          $(EXTRA_JTREG_OPTIONS)                \
+          -r:$(ABS_TEST_OUTPUT_DIR)/JTreport    \
+          -w:$(ABS_TEST_OUTPUT_DIR)/JTwork      \
+          -jdk:$(PRODUCT_HOME)                  \
+          $(JAVA_OPTIONS:%=-vmoption:%)         \
+          $(JTREG_TESTDIRS)                     \
+	  || $(BUNDLE_UP_FAILED)
+	$(BUNDLE_UP)
+
+PHONY_LIST += jtreg_tests
+
+################################################################
+
+# packtest
+
+# Expect JPRT to set JPRT_PACKTEST_HOME.
+PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
+ifdef JPRT_PACKTEST_HOME
+  PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
+endif
+
+#EXTRA_PACKTEST_OPTIONS =
+
+packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
+	( $(CD) $(PACKTEST_HOME) &&            \
+	    $(PACKTEST_HOME)/ptest             \
+		 -t "$(PRODUCT_HOME)"          \
+	         $(PACKTEST_STRESS_OPTION)     \
+		 $(EXTRA_PACKTEST_OPTIONS)     \
+		 -W $(ABS_TEST_OUTPUT_DIR)     \
+                 $(JAVA_OPTIONS:%=-J %)        \
+	 ) || $(BUNDLE_UP_FAILED)
+	$(BUNDLE_UP)
+
+packtest_stress: PACKTEST_STRESS_OPTION=-s
+packtest_stress: packtest
+
+PHONY_LIST += packtest packtest_stress
+
+################################################################
+
+# Phony targets (e.g. these are not filenames)
+.PHONY: all clean prep $(PHONY_LIST)
+
+################################################################
+
--- a/jaxp/.hgtags	Fri Sep 12 14:35:51 2008 -0700
+++ b/jaxp/.hgtags	Wed Jul 05 16:41:34 2017 +0200
@@ -9,3 +9,4 @@
 400a5ee432cc2db9031e06852ddde9264a192b48 jdk7-b32
 95375835527f0bf06124ce984266e2ad5de8a6dc jdk7-b33
 01facdf8cabdeaaf68cca037aef56cc5f074897f jdk7-b34
+eac46d1eb7f0935ba04f1c7929ec15423fd0309e jdk7-b35
--- a/jaxws/.hgtags	Fri Sep 12 14:35:51 2008 -0700
+++ b/jaxws/.hgtags	Wed Jul 05 16:41:34 2017 +0200
@@ -9,3 +9,4 @@
 e6daca2eced9d84b01255cabcfcc49164c26405e jdk7-b32
 6dcbcfb9551aaa2a80906c28ab48c9a8564e0e64 jdk7-b33
 7a9f629cd957e3169a1a769f763fe060d078785c jdk7-b34
+b0f01c2508b690dd225298edfec70b5e8b8dc367 jdk7-b35
--- a/jdk/.hgtags	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/.hgtags	Wed Jul 05 16:41:34 2017 +0200
@@ -9,3 +9,4 @@
 c51121419e30eac5f0fbbce45ff1711c4ce0de28 jdk7-b32
 fa4c0a6cdd25d97d4e6f5d7aa180bcbb0e0d56af jdk7-b33
 434055a0716ee44bca712ebca02fc04b20e6e288 jdk7-b34
+cf4894b78ceb966326e93bf221db0c2d14d59218 jdk7-b35
--- a/jdk/make/common/Defs.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/common/Defs.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -704,7 +704,20 @@
 # Install of imported file (JDK_IMPORT_PATH, or some other external location)
 define install-import-file
 @$(ECHO) "ASSEMBLY_IMPORT: $@"
-$(install-file)
+$(prep-target)
+$(CP) $< $@
+@if [ "$(PLATFORM)" = "linux" -a "$(@F)" = "libjvm.so" ] ; then     \
+  if [ -x /usr/sbin/selinuxenabled ] ; then                         \
+    /usr/sbin/selinuxenabled;                                       \
+    if [ $$? = 0 ] ; then                                           \
+      $(ECHO) "/usr/bin/chcon -t textrel_shlib_t $@";               \
+      /usr/bin/chcon -t textrel_shlib_t $@;                         \
+      if [ $$? != 0 ]; then                                         \
+        echo "ERROR: Cannot chcon $@";                              \
+      fi;                                                           \
+    fi;                                                             \
+  fi;                                                               \
+fi
 endef
 
 .PHONY: all build clean clobber
--- a/jdk/make/common/Sanity.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/common/Sanity.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright 2001-2007 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2001-2008 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -70,7 +70,6 @@
     sane-compiler \
     sane-cacerts \
     sane-ant_version \
-    sane-findbugs_version \
     sane-zip_version \
     sane-msvcrt_path
 
--- a/jdk/make/common/shared/Defs.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/common/shared/Defs.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -352,30 +352,6 @@
   HOTSPOT_DOCS_IMPORT_PATH :=$(call DirExists,$(HOTSPOT_IMPORT_PATH)/docs,$(PROMOTED_BUILD_BASEDIR)/docs,/NO_DOCS_DIR)
 endif
 
-# PREVIOUS_JDK_FILE: filename of install bundle for previous JDK
-ifdef ALT_PREVIOUS_JDK_FILE
-  PREVIOUS_JDK_FILE  =$(ALT_PREVIOUS_JDK_FILE)
-else
-  PREVIOUS_JDK_FILE = jdk-$(PREVIOUS_JDK_UNDERSCORE_VERSION)-$(PLATFORM)-$(ARCH)$(BUNDLE_FILE_SUFFIX)
-endif
-export PREVIOUS_JDK_FILE
-PREVIOUS_JDK_FILE:=$(call AltCheckSpaces,PREVIOUS_JDK_FILE)
-PREVIOUS_JDK_FILE:=$(call AltCheckValue,PREVIOUS_JDK_FILE)
-
-# PREVIOUS_JRE_FILE: filename of install bundle for previous JRE
-ifdef ALT_PREVIOUS_JRE_FILE
-  PREVIOUS_JRE_FILE  =$(ALT_PREVIOUS_JRE_FILE)
-else
-  PREVIOUS_JRE_FILE = jre-$(PREVIOUS_JDK_UNDERSCORE_VERSION)-$(PLATFORM)-$(ARCH)$(BUNDLE_FILE_SUFFIX)
-endif
-export PREVIOUS_JRE_FILE
-PREVIOUS_JRE_FILE:=$(call AltCheckSpaces,PREVIOUS_JRE_FILE)
-PREVIOUS_JRE_FILE:=$(call AltCheckValue,PREVIOUS_JRE_FILE)
-
-# Set here as shared variables
-PREVIOUS_JRE_BUNDLE = $(PREVIOUS_RELEASE_PATH)/$(PREVIOUS_JRE_FILE)
-PREVIOUS_JDK_BUNDLE = $(PREVIOUS_RELEASE_PATH)/$(PREVIOUS_JDK_FILE)
-
 # These are the same on all platforms but require the above platform include 1st
 
 # BOOTDIR: Bootstrap JDK, previous released JDK.
@@ -389,19 +365,70 @@
 BOOTDIR:=$(call AltCheckSpaces,BOOTDIR)
 BOOTDIR:=$(call AltCheckValue,BOOTDIR)
 
-# PREVIOUS_RELEASE_PATH: path to where previous release bundles are
-ifdef ALT_PREVIOUS_RELEASE_PATH
-  PREVIOUS_RELEASE_PATH :=$(call OptFullPath,$(ALT_PREVIOUS_RELEASE_PATH))
-else
-  PREVIOUS_RELEASE_PATH =$(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs/bundles/$(PLATFORM)-$(ARCH)
-endif
-export PREVIOUS_RELEASE_PATH
-PREVIOUS_RELEASE_PATH:=$(call AltCheckSpaces,PREVIOUS_RELEASE_PATH)
-PREVIOUS_RELEASE_PATH:=$(call AltCheckValue,PREVIOUS_RELEASE_PATH)
+# PREVIOUS_FCS_RE_AREA: re path to where previous release binaries/bundles are
+PREVIOUS_FCS_RE_AREA = $(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs
 
 # PREVIOUS_RELEASE_IMAGE: Previous install image to compare against
 ifdef ALT_PREVIOUS_RELEASE_IMAGE
+  
+  # Explicit image provided, no bundle access needed
   PREVIOUS_RELEASE_IMAGE :=$(call FullPath,$(ALT_PREVIOUS_RELEASE_IMAGE))
+
+else
+  
+  # PREVIOUS_RELEASE_PATH: path to where previous release bundles are
+  ifdef ALT_PREVIOUS_RELEASE_PATH
+    PREVIOUS_RELEASE_PATH :=$(call OptFullPath,$(ALT_PREVIOUS_RELEASE_PATH))
+  else
+    PREVIOUS_RELEASE_PATH := \
+	$(call DirExists,$(PREVIOUS_FCS_RE_AREA)/bundles/$(PLATFORM)-$(ARCH),,)
+  endif
+
+  # Depending on if we have access to these bundles
+  ifeq ($(PREVIOUS_RELEASE_PATH),)
+    # Use images in re area or BOOTDIR (which is normally the previous release)
+    PREVIOUS_RELEASE_IMAGE := \
+         $(call DirExists,$(PREVIOUS_FCS_RE_AREA)/binaries/$(PLATFORM)-$(ARCH),$(BOOTDIR),)
+  else
+    # Get names of and paths to bundles
+    PREVIOUS_RELEASE_PATH:=$(call AltCheckSpaces,PREVIOUS_RELEASE_PATH)
+    PREVIOUS_RELEASE_PATH:=$(call AltCheckValue,PREVIOUS_RELEASE_PATH)
+    export PREVIOUS_RELEASE_PATH
+  
+    # PREVIOUS_JDK_FILE: filename of install bundle for previous JDK
+    ifdef ALT_PREVIOUS_JDK_FILE
+      PREVIOUS_JDK_FILE  =$(ALT_PREVIOUS_JDK_FILE)
+    else
+      PREVIOUS_JDK_FILE = \
+	  jdk-$(PREVIOUS_JDK_UNDERSCORE_VERSION)-$(PLATFORM)-$(ARCH)$(BUNDLE_FILE_SUFFIX)
+    endif
+    export PREVIOUS_JDK_FILE
+    PREVIOUS_JDK_FILE:=$(call AltCheckSpaces,PREVIOUS_JDK_FILE)
+    PREVIOUS_JDK_FILE:=$(call AltCheckValue,PREVIOUS_JDK_FILE)
+
+    # PREVIOUS_JRE_FILE: filename of install bundle for previous JRE
+    ifdef ALT_PREVIOUS_JRE_FILE
+      PREVIOUS_JRE_FILE  =$(ALT_PREVIOUS_JRE_FILE)
+    else
+      PREVIOUS_JRE_FILE = \
+	  jre-$(PREVIOUS_JDK_UNDERSCORE_VERSION)-$(PLATFORM)-$(ARCH)$(BUNDLE_FILE_SUFFIX)
+    endif
+    export PREVIOUS_JRE_FILE
+    PREVIOUS_JRE_FILE:=$(call AltCheckSpaces,PREVIOUS_JRE_FILE)
+    PREVIOUS_JRE_FILE:=$(call AltCheckValue,PREVIOUS_JRE_FILE)
+   
+    # Paths to these bundles
+    PREVIOUS_JRE_BUNDLE = $(PREVIOUS_RELEASE_PATH)/$(PREVIOUS_JRE_FILE)
+    PREVIOUS_JDK_BUNDLE = $(PREVIOUS_RELEASE_PATH)/$(PREVIOUS_JDK_FILE)
+  endif
+
+endif
+
+# Indicate we are using an image comparison
+ifneq ($(PREVIOUS_RELEASE_IMAGE),)
+    PREVIOUS_RELEASE_PATH = USING-PREVIOUS_RELEASE_IMAGE
+    PREVIOUS_JRE_BUNDLE   = USING-PREVIOUS_RELEASE_IMAGE
+    PREVIOUS_JDK_BUNDLE   = USING-PREVIOUS_RELEASE_IMAGE
 endif
 
 # CACERTS_FILE: if OPENJDK is false and the internal version of the file 
@@ -513,23 +540,17 @@
   endif
 endif
 
-# Utilities ant and findbugs
-ifeq ($(ANT_HOME),)
-  ANT_HOME := $(call DirExists,/usr/share/ant,$(JDK_DEVTOOLS_DIR)/share/ant/latest,)
+# Utilities ant
+ifeq ($(PLATFORM), windows)
+  ifeq ($(ANT_HOME),)
+    ANT_HOME := $(call DirExists,$(JDK_DEVTOOLS_DIR)/share/ant/latest,,)
+  endif
 endif
 ifeq ($(ANT_HOME),)
   ANT = ant
 else
   ANT = $(ANT_HOME)/bin/ant
 endif
-ifeq ($(FINDBUGS_HOME),)
-  FINDBUGS_HOME := $(call DirExists,/usr/share/findbugs,$(JDK_DEVTOOLS_DIR)/share/findbugs/latest,)
-endif
-ifeq ($(FINDBUGS_HOME),)
-  FINDBUGS = findbugs
-else
-  FINDBUGS = $(FINDBUGS_HOME)/bin/findbugs
-endif
 
 ifdef ALT_COPYRIGHT_YEAR
   COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
--- a/jdk/make/common/shared/Sanity-Settings.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/common/shared/Sanity-Settings.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -79,7 +79,6 @@
 ALL_SETTINGS+=$(call addRequiredSetting,VARIANT)
 ALL_SETTINGS+=$(call addAltSetting,JDK_DEVTOOLS_DIR)
 ALL_SETTINGS+=$(call addOptionalSetting,ANT_HOME)
-ALL_SETTINGS+=$(call addOptionalSetting,FINDBUGS_HOME)
 ALL_SETTINGS+=$(call addAltSetting,UNIXCOMMAND_PATH)
 ALL_SETTINGS+=$(call addAltSetting,COMPILER_PATH)
 ALL_SETTINGS+=$(call addAltSetting,DEVTOOLS_PATH)
@@ -119,7 +118,6 @@
   ALL_SETTINGS+=$(call addRequiredVersionSetting,LINK_VER)
 endif
 ALL_SETTINGS+=$(call addRequiredVersionSetting,ANT_VER)
-ALL_SETTINGS+=$(call addRequiredVersionSetting,FINDBUGS_VER)
 ALL_SETTINGS+=$(call addRequiredSetting,TEMPDIR)
 
 
--- a/jdk/make/common/shared/Sanity.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/common/shared/Sanity.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -107,21 +107,9 @@
 BOOT_VER   :=$(call GetVersion,"$(_BOOT_VER)")
 
 REQUIRED_ANT_VER := 1.6.3
-ifeq ($(ANT_HOME),)
-  _ANT_VER:=$(shell JAVACMD="$(BOOTDIR)/bin/java" $(ANT) -version 2>&1 )
-else
-  _ANT_VER:=$(shell JAVACMD="$(BOOTDIR)/bin/java" ANT_HOME="$(ANT_HOME)" $(ANT) -version 2>&1 )
-endif
+_ANT_VER:=$(shell $(ANT) -version 2>&1 )
 ANT_VER:=$(call GetVersion,"$(_ANT_VER)")
 
-REQUIRED_FINDBUGS_VER := 1.2
-ifeq ($(FINDBUGS_HOME),)
-  _FINDBUGS_VER:=$(shell $(FINDBUGS) -javahome "$(BOOTDIR)" -textui -version 2>&1 )
-else
-  _FINDBUGS_VER:=$(shell FINDBUGS_HOME="$(FINDBUGS_HOME)" $(FINDBUGS) -javahome "$(BOOTDIR)" -textui -version 2>&1 )
-endif
-FINDBUGS_VER:=$(call GetVersion,"$(_FINDBUGS_VER)")
-
 ifdef ALT_BINDIR
   ALT_BINDIR_VERSION := $(shell $(ALT_BINDIR)/java$(EXE_SUFFIX) -version 2>&1  | $(NAWK) -F'"' '{ print $$2 }')
   ALT_BINDIR_OK := $(shell $(ECHO) $(ALT_BINDIR_VERSION) | $(EGREP) -c '^$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)')
@@ -182,7 +170,6 @@
 	sane-alsa-versioncheck \
 	sane-alsa-headers \
 	sane-ant_version \
-	sane-findbugs_version \
 	sane-zip_version \
 	sane-unzip_version \
  	sane-msvcrt_path \
@@ -1217,19 +1204,6 @@
 	fi
 
 ######################################################
-# Check the findbugs version
-######################################################
-FINDBUGS_CHECK :=$(call CheckVersions,$(FINDBUGS_VER),$(REQUIRED_FINDBUGS_VER))
-sane-findbugs_version:
-	@if [ "$(FINDBUGS_CHECK)" != "same" \
-	      -a "$(FINDBUGS_CHECK)" != "newer" ]; then \
-	  $(ECHO) "WARNING: The version of findbugs being used is older than \n" \
-	    "      the required version of '$(REQUIRED_FINDBUGS_VER)'. \n" \
-	    "      The version of findbugs found was '$(FINDBUGS_VER)'. \n" \
-	    "" >> $(WARNING_FILE) ; \
-	fi
-
-######################################################
 # Check the zip file version
 ######################################################
 ZIP_CHECK :=$(call CheckVersions,$(ZIP_VER),$(REQUIRED_ZIP_VER))
--- a/jdk/make/docs/CORE_PKGS.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/docs/CORE_PKGS.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -158,6 +158,7 @@
   javax.management.event                         \
   javax.management.loading                       \
   javax.management.monitor                       \
+  javax.management.namespace                     \
   javax.management.relation                      \
   javax.management.openmbean                     \
   javax.management.timer                         \
--- a/jdk/make/java/java/FILES_java.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/java/java/FILES_java.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -449,6 +449,7 @@
     sun/misc/JavaLangAccess.java \
     sun/misc/JavaIOAccess.java \
     sun/misc/JavaIODeleteOnExitAccess.java \
-    sun/misc/JavaIOFileDescriptorAccess.java
+    sun/misc/JavaIOFileDescriptorAccess.java \
+    sun/misc/JavaNioAccess.java
 
 FILES_java = $(JAVA_JAVA_java)
--- a/jdk/make/java/java/mapfile-vers	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/java/java/mapfile-vers	Wed Jul 05 16:41:34 2017 +0200
@@ -222,8 +222,6 @@
 		Java_java_lang_UNIXProcess_waitForProcessExit;
 		Java_java_lang_UNIXProcess_forkAndExec;
 		Java_java_lang_UNIXProcess_destroyProcess;
-                Java_java_nio_Bits_copyFromByteArray;
-                Java_java_nio_Bits_copyToByteArray;
                 Java_java_nio_Bits_copyFromShortArray;
                 Java_java_nio_Bits_copyToShortArray;
                 Java_java_nio_Bits_copyFromIntArray;
--- a/jdk/make/java/jli/Makefile	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/java/jli/Makefile	Wed Jul 05 16:41:34 2017 +0200
@@ -113,7 +113,11 @@
 	JAVALIB =
 	OTHER_LCF =  -export:JLI_Launch \
 		     -export:JLI_ManifestIterate \
-		     -export:JLI_SetTraceLauncher
+		     -export:JLI_SetTraceLauncher \
+		     -export:JLI_ReportErrorMessage \
+		     -export:JLI_ReportErrorMessageSys \
+		     -export:JLI_ReportMessage \
+		     -export:JLI_ReportExceptionDescription
 
 endif
 
--- a/jdk/make/java/jli/mapfile-vers	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/java/jli/mapfile-vers	Wed Jul 05 16:41:34 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,10 @@
 		JLI_Launch;
 		JLI_ManifestIterate;
 		JLI_SetTraceLauncher;
+		JLI_ReportErrorMessage;
+		JLI_ReportErrorMessageSys;
+		JLI_ReportMessage;
+		JLI_ReportExceptionDescription;
 	local:
 		*;
 };
--- a/jdk/make/java/nio/FILES_java.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/java/nio/FILES_java.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -26,6 +26,7 @@
 FILES_src = \
 	java/nio/Bits.java \
 	java/nio/Buffer.java \
+	java/nio/BufferPoolMXBean.java \
 	java/nio/ByteOrder.java \
 	java/nio/MappedByteBuffer.java \
 	java/nio/StringCharBuffer.java \
@@ -38,6 +39,9 @@
 	java/nio/channels/FileLock.java \
 	java/nio/channels/GatheringByteChannel.java \
 	java/nio/channels/InterruptibleChannel.java \
+	java/nio/channels/MembershipKey.java \
+	java/nio/channels/MulticastChannel.java \
+	java/nio/channels/NetworkChannel.java \
 	java/nio/channels/ReadableByteChannel.java \
 	java/nio/channels/ScatteringByteChannel.java \
 	java/nio/channels/SelectableChannel.java \
@@ -72,6 +76,7 @@
 	sun/nio/ch/DatagramSocketAdaptor.java \
         sun/nio/ch/DefaultSelectorProvider.java \
 	sun/nio/ch/DirectBuffer.java \
+	sun/nio/ch/ExtendedSocketOption.java \
 	sun/nio/ch/FileChannelImpl.java \
 	sun/nio/ch/FileDispatcher.java \
 	sun/nio/ch/FileKey.java \
@@ -79,12 +84,14 @@
 	sun/nio/ch/IOUtil.java \
 	sun/nio/ch/IOStatus.java \
 	sun/nio/ch/IOVecWrapper.java \
+	sun/nio/ch/MembershipKeyImpl.java \
+	sun/nio/ch/MembershipRegistry.java \
 	sun/nio/ch/NativeDispatcher.java \
 	sun/nio/ch/NativeObject.java \
 	sun/nio/ch/NativeThread.java \
 	sun/nio/ch/NativeThreadSet.java \
 	sun/nio/ch/Net.java \
-	sun/nio/ch/OptionAdaptor.java \
+	sun/nio/ch/OptionKey.java \
 	sun/nio/ch/PipeImpl.java \
 	sun/nio/ch/PollArrayWrapper.java \
 	sun/nio/ch/Reflect.java \
@@ -98,8 +105,7 @@
 	sun/nio/ch/SocketAdaptor.java \
 	sun/nio/ch/SocketChannelImpl.java \
 	sun/nio/ch/SocketDispatcher.java \
-	sun/nio/ch/SocketOpts.java \
-	sun/nio/ch/SocketOptsImpl.java \
+	sun/nio/ch/SocketOptionRegistry.java \
         sun/nio/ch/SourceChannelImpl.java \
 	sun/nio/ch/Util.java \
 	\
@@ -239,6 +245,7 @@
 	java/nio/InvalidMarkException.java \
 	java/nio/ReadOnlyBufferException.java \
 	\
+	java/nio/channels/AlreadyBoundException.java \
 	java/nio/channels/AlreadyConnectedException.java \
 	java/nio/channels/AsynchronousCloseException.java \
 	java/nio/channels/ClosedByInterruptException.java \
@@ -257,14 +264,15 @@
 	java/nio/channels/UnresolvedAddressException.java \
 	java/nio/channels/UnsupportedAddressTypeException.java \
 	\
-	sun/nio/ch/AlreadyBoundException.java \
-	\
 	java/nio/charset/CharacterCodingException.java \
 	java/nio/charset/IllegalCharsetNameException.java \
 	java/nio/charset/UnsupportedCharsetException.java
 
 FILES_gen_csp = sun/nio/cs/StandardCharsets.java
 
-FILES_gen = $(FILES_gen_coder) $(FILES_gen_buffer) $(FILES_gen_ex) $(FILES_gen_csp)
+FILES_gen_sor = sun/nio/ch/SocketOptionRegistry.java
+
+FILES_gen = $(FILES_gen_coder) $(FILES_gen_buffer) $(FILES_gen_ex) \
+    $(FILES_gen_csp) $(FILES_gen_sor)
 
 FILES_java = $(FILES_src) $(FILES_gen)
--- a/jdk/make/java/nio/Makefile	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/java/nio/Makefile	Wed Jul 05 16:41:34 2017 +0200
@@ -56,18 +56,18 @@
         sun/nio/ch/DevPollSelectorProvider.java \
 	sun/nio/ch/InheritedChannel.java \
         sun/nio/ch/PollSelectorProvider.java \
-        sun/nio/ch/PollSelectorImpl.java 
+        sun/nio/ch/PollSelectorImpl.java
 
 FILES_c += \
         DevPollArrayWrapper.c \
 	InheritedChannel.c \
-        PollArrayWrapper.c \
-	NativeThread.c
+	NativeThread.c \
+        PollArrayWrapper.c
 
 FILES_export += \
 	sun/nio/ch/DevPollArrayWrapper.java \
 	sun/nio/ch/InheritedChannel.java \
-	sun/nio/ch/NativeThread.java 
+	sun/nio/ch/NativeThread.java
 endif # PLATFORM = solaris
 
 ifeq ($(PLATFORM), windows)
@@ -94,14 +94,14 @@
 
 FILES_c += \
 	EPollArrayWrapper.c \
-        PollArrayWrapper.c \
 	InheritedChannel.c \
-	NativeThread.c
+	NativeThread.c \
+        PollArrayWrapper.c
 
 FILES_export += \
         sun/nio/ch/EPollArrayWrapper.java \
 	sun/nio/ch/InheritedChannel.java \
-	sun/nio/ch/NativeThread.java 
+	sun/nio/ch/NativeThread.java
 endif # PLATFORM = linux
 
 # Find platform-specific C source files
@@ -618,12 +618,6 @@
 	@$(RM) $@.temp
 	$(GEN_EX_CMD) $(BUF_SRC)/exceptions $(BUF_GEN)
 
-$(SCH_GEN)/%Exception.java: genExceptions.sh $(SCH_SRC)/exceptions
-	$(prep-target)
-	@$(RM) $@.temp
-	$(GEN_EX_CMD) $(SCH_SRC)/exceptions $(SCH_GEN)
-
-
 #
 # Generated charset-provider classes
 #
@@ -638,4 +632,29 @@
 	  HASHER="$(BOOT_JAVA_CMD) -jar $(HASHER_JARFILE)" \
 	  $(SH) -e genCharsetProvider.sh $(SCS_SRC)/standard-charsets $(SCS_GEN)
 
+#
+# Generated channel implementation classes.
+# C source is compiled in TEMPDIR to avoid turds left by Windows compilers.
+#
+
+GENSOR_SRC = $(SHARE_SRC)/native/sun/nio/ch/genSocketOptionRegistry.c
+
+GENSOR_EXE = $(TEMPDIR)/genSocketOptionRegistry$(EXE_SUFFIX)
+
+SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSOR_SRC) | \
+	$(NAWK) '/^.*Copyright.*Sun/ { print $$3 }') 
+
+$(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC)
+	$(install-file)
+
+$(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
+	$(prep-target)
+	($(CD) $(TEMPDIR); $(CC) $(CPPFLAGS) $(LDDFLAGS) \
+	   -o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC))
+
+$(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE)
+	$(prep-target)
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh $(SOR_COPYRIGHT_YEARS) > $@
+	$(GENSOR_EXE) >> $@
+
 .PHONY: sources 
--- a/jdk/make/java/nio/mapfile-linux	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/java/nio/mapfile-linux	Wed Jul 05 16:41:34 2017 +0200
@@ -1,3 +1,27 @@
+#
+# Copyright 2001-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
 
 SUNWprivate_1.1 {
 	global:
@@ -18,6 +42,8 @@
 		Java_sun_nio_ch_EPollArrayWrapper_fdLimit;
 		Java_sun_nio_ch_EPollArrayWrapper_init;
 		Java_sun_nio_ch_EPollArrayWrapper_interrupt;
+		Java_sun_nio_ch_EPollArrayWrapper_offsetofData;
+		Java_sun_nio_ch_EPollArrayWrapper_sizeofEPollEvent;
                 Java_sun_nio_ch_FileChannelImpl_close0;
                 Java_sun_nio_ch_FileChannelImpl_force0;
                 Java_sun_nio_ch_FileChannelImpl_initIDs;
@@ -59,20 +85,29 @@
 		Java_sun_nio_ch_NativeThread_init;
 		Java_sun_nio_ch_NativeThread_signal;
 		Java_sun_nio_ch_Net_socket0;
-		Java_sun_nio_ch_Net_bind;
-		Java_sun_nio_ch_Net_connect;
+		Java_sun_nio_ch_Net_bind0;
+		Java_sun_nio_ch_Net_connect0;
+		Java_sun_nio_ch_Net_listen;
 		Java_sun_nio_ch_Net_localPort;
 		Java_sun_nio_ch_Net_localInetAddress;
 		Java_sun_nio_ch_Net_getIntOption0;
 		Java_sun_nio_ch_Net_setIntOption0;
                 Java_sun_nio_ch_Net_initIDs;
+		Java_sun_nio_ch_Net_isIPv6Available0;
+		Java_sun_nio_ch_Net_joinOrDrop4;
+		Java_sun_nio_ch_Net_blockOrUnblock4;
+		Java_sun_nio_ch_Net_joinOrDrop6;
+		Java_sun_nio_ch_Net_blockOrUnblock6;
+		Java_sun_nio_ch_Net_setInterface4;
+		Java_sun_nio_ch_Net_getInterface4;
+		Java_sun_nio_ch_Net_setInterface6;
+		Java_sun_nio_ch_Net_getInterface6;
+		Java_sun_nio_ch_Net_shutdown;
                 Java_sun_nio_ch_PollArrayWrapper_interrupt;
                 Java_sun_nio_ch_PollArrayWrapper_poll0;
                 Java_sun_nio_ch_ServerSocketChannelImpl_accept0;
                 Java_sun_nio_ch_ServerSocketChannelImpl_initIDs;
-		Java_sun_nio_ch_ServerSocketChannelImpl_listen;
                 Java_sun_nio_ch_SocketChannelImpl_checkConnect;
-		Java_sun_nio_ch_SocketChannelImpl_shutdown;
 
 	local:
 		*;
--- a/jdk/make/java/nio/mapfile-solaris	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/java/nio/mapfile-solaris	Wed Jul 05 16:41:34 2017 +0200
@@ -1,3 +1,27 @@
+#
+# Copyright 2001-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
 
 SUNWprivate_1.1 {
 	global:
@@ -59,20 +83,29 @@
 		Java_sun_nio_ch_NativeThread_init;
 		Java_sun_nio_ch_NativeThread_signal;
 		Java_sun_nio_ch_Net_socket0;
-		Java_sun_nio_ch_Net_bind;
-		Java_sun_nio_ch_Net_connect;
+		Java_sun_nio_ch_Net_bind0;
+		Java_sun_nio_ch_Net_connect0;
+		Java_sun_nio_ch_Net_listen;
 		Java_sun_nio_ch_Net_localPort;
 		Java_sun_nio_ch_Net_localInetAddress;
 		Java_sun_nio_ch_Net_getIntOption0;
 		Java_sun_nio_ch_Net_setIntOption0;
                 Java_sun_nio_ch_Net_initIDs;
+		Java_sun_nio_ch_Net_isIPv6Available0;
+		Java_sun_nio_ch_Net_joinOrDrop4;
+		Java_sun_nio_ch_Net_blockOrUnblock4;
+		Java_sun_nio_ch_Net_joinOrDrop6;
+		Java_sun_nio_ch_Net_blockOrUnblock6;
+		Java_sun_nio_ch_Net_setInterface4;
+		Java_sun_nio_ch_Net_getInterface4;
+		Java_sun_nio_ch_Net_setInterface6;
+		Java_sun_nio_ch_Net_getInterface6;
+		Java_sun_nio_ch_Net_shutdown;
                 Java_sun_nio_ch_PollArrayWrapper_interrupt;
                 Java_sun_nio_ch_PollArrayWrapper_poll0;
                 Java_sun_nio_ch_ServerSocketChannelImpl_accept0;
                 Java_sun_nio_ch_ServerSocketChannelImpl_initIDs;
-		Java_sun_nio_ch_ServerSocketChannelImpl_listen;
                 Java_sun_nio_ch_SocketChannelImpl_checkConnect;
-		Java_sun_nio_ch_SocketChannelImpl_shutdown;
 
 	local:
 		*;
--- a/jdk/make/jprt.config	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/jprt.config	Wed Jul 05 16:41:34 2017 +0200
@@ -100,20 +100,16 @@
 # Needed for langtools, maybe other parts of the build
 ANT_HOME="${share}/ant/latest"
 export ANT_HOME
-FINDBUGS_HOME="${share}/findbugs/latest"
-export FINDBUGS_HOME
 
 # The 3 bin directories in common to all platforms
 sharebin="${share}/bin"
 antbin="${ANT_HOME}/bin"
-findbugsbin="${FINDBUGS_HOME}/bin"
 
 # Check input
 dirMustExist "${bootdir}"         ALT_BOOTDIR
 dirMustExist "${slashjava}"       ALT_SLASH_JAVA
 dirMustExist "${jdk_import}"      ALT_JDK_IMPORT_PATH
 dirMustExist "${ANT_HOME}"        ANT_HOME
-dirMustExist "${FINDBUGS_HOME}"   FINDBUGS_HOME
 
 # Use the JDK import for now (FIXME: use the binary plugs?)
 if [ "${OPENJDK}" = true ] ; then
@@ -143,7 +139,7 @@
     ALT_COMPILER_PATH="${compiler_path}"
     export ALT_COMPILER_PATH
     dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    path4sdk=${compiler_path}:${sharebin}:${antbin}:${findbugsbin}
+    path4sdk=${compiler_path}:${sharebin}:${antbin}
 
     # Add basic solaris system paths
     path4sdk=${path4sdk}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
@@ -180,7 +176,7 @@
     ALT_COMPILER_PATH="${compiler_path}"
     export ALT_COMPILER_PATH
     dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    path4sdk=${compiler_path}:${sharebin}:${antbin}:${findbugsbin}
+    path4sdk=${compiler_path}:${sharebin}:${antbin}
     
     # Add basic paths
     path4sdk=${path4sdk}:/usr/bin:/bin:/usr/sbin:/sbin
@@ -228,7 +224,7 @@
 	dosname="${mkshome}/mksnt/dosname -s"
         # Most unix utilities are in the mksnt directory of ROOTDIR
         unixcommand_path="${mkshome}/mksnt"
-        path4sdk="${sharebin};${antbin};${findbugsbin};${unixcommand_path}"
+        path4sdk="${sharebin};${antbin};${unixcommand_path}"
         dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
 	devtools_path="${jdk_devtools}/win32/bin"
 	path4sdk="${devtools_path};${path4sdk}"
@@ -246,7 +242,7 @@
 	dosname="/usr/bin/cygpath -a -m -s"
         # Most unix utilities are in the /usr/bin
         unixcommand_path="/usr/bin"
-        path4sdk="${sharebin};${antbin};${findbugsbin};${unixcommand_path}"
+        path4sdk="${sharebin};${antbin};${unixcommand_path}"
         dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
         # Find GNU make
         make="${unixcommand_path}/make.exe"
--- a/jdk/make/mksample/nio/Makefile	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/mksample/nio/Makefile	Wed Jul 05 16:41:34 2017 +0200
@@ -31,7 +31,7 @@
 PRODUCT = java
 include $(BUILDDIR)/common/Defs.gmk
 
-SUBDIRS = server
+SUBDIRS = multicast server
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/mksample/nio/multicast/Makefile	Wed Jul 05 16:41:34 2017 +0200
@@ -0,0 +1,52 @@
+#
+# Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
+# Makefile for the nio/multicast sample code
+#
+
+BUILDDIR = ../../..
+
+PRODUCT = java
+
+include $(BUILDDIR)/common/Defs.gmk
+
+SAMPLE_SRC_DIR = $(SHARE_SRC)/sample/nio/multicast
+SAMPLE_DST_DIR = $(SAMPLEDIR)/nio/multicast
+
+SAMPLE_FILES =							\
+	$(SAMPLE_DST_DIR)/Reader.java				\
+	$(SAMPLE_DST_DIR)/Sender.java				\
+	$(SAMPLE_DST_DIR)/MulticastAddress.java
+
+all build: $(SAMPLE_FILES)
+
+$(SAMPLE_DST_DIR)/%: $(SAMPLE_SRC_DIR)/%
+	$(install-file)
+
+clean clobber:
+	$(RM) -r $(SAMPLE_DST_DIR)
+
+.PHONY: all build clean clobber
--- a/jdk/make/sun/awt/FILES_c_unix.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/sun/awt/FILES_c_unix.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -142,59 +142,59 @@
 # These files rely on motif to be built, and should not be included
 # in a headless build.
 
-FILES_MOTIF_c = \
-	awt_AWTEvent.c \
-	awt_Button.c \
-	awt_Canvas.c \
-	awt_Checkbox.c \
-	awt_Component.c \
-	awt_Cursor.c \
-	awt_DataTransferer.c \
-	awt_DrawingSurface.c \
-	awt_Event.c \
-	awt_FileDialog.c \
-	awt_GlobalCursorManager.c \
-	awt_GraphicsEnv.c \
-	awt_InputMethod.c \
-	awt_Insets.c \
-	awt_KeyboardFocusManager.c \
-	awt_Label.c \
-	awt_List.c \
-	awt_Menu.c \
-	awt_MenuBar.c \
-	awt_MenuComponent.c \
-	awt_MenuItem.c \
-	awt_motif.c \
-	awt_Plugin.c \
-	awt_PopupMenu.c \
-	awt_Robot.c \
-	awt_Scrollbar.c \
-	awt_ScrollPane.c \
-	awt_Selection.c \
-	awt_UNIXToolkit.c \
-	awt_TextArea.c \
-	awt_TextField.c \
-	awt_TopLevel.c \
-	awt_mgrsel.c \
-	awt_util.c \
-	awt_wm.c \
-	awt_XmDnD.c \
-	awt_dnd.c \
-	awt_dnd_ds.c \
-	awt_dnd_dt.c \
-	canvas.c \
-	cursor.c \
-	multi_font.c \
-	robot_common.c \
-        list.c \
-        multiVis.c \
-	XDrawingArea.c \
-	MouseInfo.c \
-	awt_xembed.c \
-	awt_xembed_server.c \
-        gtk2_interface.c \
-        swing_GTKEngine.c \
-        swing_GTKStyle.c
+#FILES_MOTIF_c = \
+#keep	awt_AWTEvent.c \
+#	awt_Button.c \
+#	awt_Canvas.c \
+#	awt_Checkbox.c \
+#keep .h	awt_Component.c \
+#keep .h	awt_Cursor.c \
+#	awt_DataTransferer.c \
+#	awt_DrawingSurface.c \
+#	awt_Event.c \
+#	awt_FileDialog.c \
+#	awt_GlobalCursorManager.c \
+#	awt_GraphicsEnv.c \
+#	awt_InputMethod.c \
+#keep	awt_Insets.c \
+#	awt_KeyboardFocusManager.c \
+#	awt_Label.c \
+#	awt_List.c \
+#	awt_Menu.c \
+#	awt_MenuBar.c \
+#	awt_MenuComponent.c \
+#	awt_MenuItem.c \
+#	awt_motif.c \
+#	awt_Plugin.c \
+#	awt_PopupMenu.c \
+#	awt_Robot.c \
+#	awt_Scrollbar.c \
+#	awt_ScrollPane.c \
+#	awt_Selection.c \
+#	awt_UNIXToolkit.c \
+#	awt_TextArea.c \
+#	awt_TextField.c \
+#	awt_TopLevel.c \
+#	awt_mgrsel.c \
+#	awt_util.c \
+#	awt_wm.c \
+#	awt_XmDnD.c \
+#	awt_dnd.c \
+#	awt_dnd_ds.c \
+#	awt_dnd_dt.c \
+#	canvas.c \
+#	cursor.c \
+#	multi_font.c \
+#	robot_common.c \
+#        list.c \
+#        multiVis.c \
+#	XDrawingArea.c \
+#	MouseInfo.c \
+#	awt_xembed.c \
+#	awt_xembed_server.c \
+#        gtk2_interface.c \
+#        swing_GTKEngine.c \
+#        swing_GTKStyle.c
 
 
 # These files are required to be built, with or without motif.  Some of
--- a/jdk/make/sun/awt/FILES_export_unix.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/sun/awt/FILES_export_unix.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -60,48 +60,15 @@
 	sun/awt/image/DataBufferNative.java \
 	\
 	sun/awt/motif/X11FontMetrics.java \
-	sun/awt/motif/X11Clipboard.java \
-	sun/awt/motif/X11Selection.java \
-	sun/awt/motif/X11SelectionHolder.java \
 	sun/awt/X11InputMethod.java \
-	sun/awt/motif/MInputMethod.java \
-	sun/awt/motif/MInputMethodControl.java \
-	sun/awt/motif/MCustomCursor.java \
 	sun/awt/motif/MFontConfiguration.java \
 	sun/awt/motif/MFontPeer.java \
 	sun/awt/motif/MToolkit.java \
-	sun/awt/motif/MComponentPeer.java \
-	sun/awt/motif/MButtonPeer.java \
-	sun/awt/motif/MCanvasPeer.java \
-	sun/awt/motif/MCheckboxPeer.java \
-	sun/awt/motif/MFileDialogPeer.java \
-	sun/awt/motif/MGlobalCursorManager.java \
-	sun/awt/motif/MTextFieldPeer.java \
-	sun/awt/motif/MLabelPeer.java \
-	sun/awt/motif/MListPeer.java \
-	sun/awt/motif/MWindowPeer.java \
-	sun/awt/motif/MMenuBarPeer.java \
-	sun/awt/motif/MMenuPeer.java \
-        sun/awt/motif/MPopupMenuPeer.java \
-	sun/awt/motif/MDialogPeer.java \
-	sun/awt/motif/MMenuItemPeer.java \
-	sun/awt/motif/MCheckboxMenuItemPeer.java \
-	sun/awt/motif/MChoicePeer.java \
-	sun/awt/motif/MTextAreaPeer.java \
-	sun/awt/motif/MScrollbarPeer.java \
-	sun/awt/motif/MScrollPanePeer.java \
-	sun/awt/motif/MFramePeer.java \
         sun/awt/DebugSettings.java \
 	sun/awt/EmbeddedFrame.java \
-	sun/awt/motif/MEmbeddedFramePeer.java \
 	sun/awt/PlatformFont.java \
 	sun/awt/FontDescriptor.java \
 	sun/awt/NativeLibLoader.java \
-	sun/awt/motif/MDropTargetContextPeer.java \
-	sun/awt/motif/MDragSourceContextPeer.java \
-	sun/awt/motif/MRobotPeer.java \
-	sun/awt/motif/X11DragSourceContextPeer.java \
-	sun/awt/motif/X11DropTargetContextPeer.java \
 	sun/awt/X11GraphicsEnvironment.java \
 	sun/awt/X11GraphicsDevice.java \
 	sun/awt/X11GraphicsConfig.java \
@@ -124,7 +91,6 @@
         sun/java2d/cmm/ColorTransform.java \
         sun/awt/datatransfer/DataTransferer.java \
 	sun/awt/dnd/SunDragSourceContextPeer.java \
-	sun/awt/motif/MDataTransferer.java \
 	sun/awt/motif/MToolkitThreadBlockedHandler.java \
 	sun/java2d/opengl/OGLBlitLoops.java \
 	sun/java2d/opengl/OGLContext.java \
@@ -220,6 +186,5 @@
 	java/awt/event/NativeLibLoader.java \
 	java/awt/peer/ComponentPeer.java \
 	java/awt/dnd/DnDConstants.java \
-	sun/awt/CausedFocusEvent.java \
-	sun/awt/motif/MEmbedCanvasPeer.java
+	sun/awt/CausedFocusEvent.java
 
--- a/jdk/make/sun/awt/mapfile-mawt-vers	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/sun/awt/mapfile-mawt-vers	Wed Jul 05 16:41:34 2017 +0200
@@ -31,7 +31,7 @@
 	global:
 		JNI_OnLoad;
 
-                Java_sun_awt_motif_MComponentPeer_restoreFocus;
+                #Java_sun_awt_motif_MComponentPeer_restoreFocus;
 		Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords;
 		Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse;
 		Java_java_awt_AWTEvent_nativeSetSource;
@@ -56,163 +56,163 @@
                 Java_sun_awt_UNIXToolkit_load_1stock_1icon;
                 Java_sun_awt_UNIXToolkit_load_1gtk_1icon;
 		Java_sun_awt_UNIXToolkit_nativeSync;
-		Java_sun_awt_motif_MButtonPeer_create;
-		Java_sun_awt_motif_MButtonPeer_setLabel;
-                Java_sun_awt_motif_MPanelPeer_pEnsureIndex;
-                Java_sun_awt_motif_MPanelPeer_pRestack;
-		Java_sun_awt_motif_MCanvasPeer_create;
-		Java_sun_awt_motif_MCanvasPeer_initIDs;
-		Java_sun_awt_motif_MCanvasPeer_resetTargetGC;
-		Java_sun_awt_motif_MCheckboxMenuItemPeer_pSetState;
-		Java_sun_awt_motif_MCheckboxPeer_create;
-		Java_sun_awt_motif_MCheckboxPeer_setCheckboxGroup;
-		Java_sun_awt_motif_MCheckboxPeer_setLabel;
-		Java_sun_awt_motif_MCheckboxPeer_pSetState;
-		Java_sun_awt_motif_MCheckboxPeer_pGetState;
-		Java_sun_awt_motif_MChoicePeer_addItem;
-		Java_sun_awt_motif_MChoicePeer_appendItems;
-		Java_sun_awt_motif_MChoicePeer_create;
-		Java_sun_awt_motif_MChoicePeer_pReshape;
-		Java_sun_awt_motif_MChoicePeer_remove;
-		Java_sun_awt_motif_MChoicePeer_removeAll;
-		Java_sun_awt_motif_MChoicePeer_setBackground;
-		Java_sun_awt_motif_MChoicePeer_pSelect;
-		Java_sun_awt_motif_MChoicePeer_setFont;
-		Java_sun_awt_motif_MChoicePeer_setForeground;
-		Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
-		Java_sun_awt_motif_MComponentPeer_getNativeColor;
-		Java_sun_awt_motif_MComponentPeer_getWindow;
-		Java_sun_awt_motif_MComponentPeer_pDisable;
-		Java_sun_awt_motif_MComponentPeer_pDispose;
-		Java_sun_awt_motif_MComponentPeer_pEnable;
-		Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen;
-		Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen2;
-		Java_sun_awt_motif_MComponentPeer_pHide;
-		Java_sun_awt_motif_MComponentPeer_pInitialize;
-		Java_sun_awt_motif_MComponentPeer_pMakeCursorVisible;
-		Java_sun_awt_motif_MComponentPeer_pReshape;
-		Java_sun_awt_motif_MComponentPeer_pShow;
-		Java_sun_awt_motif_MComponentPeer_removeNativeDropTarget;
-		Java_sun_awt_motif_MComponentPeer_pSetBackground;
-		Java_sun_awt_motif_MComponentPeer_pSetFont;
-                Java_sun_awt_motif_MComponentPeer_processSynchronousLightweightTransfer;
-                Java_sun_awt_motif_MComponentPeer__1requestFocus;
-                Java_sun_awt_motif_MComponentPeer_getNativeFocusedWindow;
-		Java_sun_awt_motif_MCheckboxMenuItemPeer_getState;
-		Java_sun_awt_motif_MComponentPeer_pSetForeground;
-		Java_sun_awt_motif_MDragSourceContextPeer_startDrag;
-		Java_sun_awt_motif_MDragSourceContextPeer_setNativeCursor;
-		Java_sun_awt_motif_MDropTargetContextPeer_addTransfer;
-		Java_sun_awt_motif_MDropTargetContextPeer_dropDone;
-		Java_sun_awt_motif_MDropTargetContextPeer_startTransfer;
-		Java_sun_awt_motif_X11DragSourceContextPeer_startDrag;
-		Java_sun_awt_motif_X11DragSourceContextPeer_setNativeCursor;
-		Java_sun_awt_motif_X11DropTargetContextPeer_sendResponse;
-		Java_sun_awt_motif_X11DropTargetContextPeer_dropDone;
-		Java_sun_awt_motif_X11DropTargetContextPeer_getData;
-		Java_sun_awt_motif_MEmbeddedFramePeer_NEFcreate;
-		Java_sun_awt_motif_MEmbeddedFramePeer_pShowImpl;
-		Java_sun_awt_motif_MEmbeddedFramePeer_requestXEmbedFocus;
-		Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedApplicationActive;
-		Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedActive;
-                Java_sun_awt_motif_MEmbeddedFramePeer_synthesizeFocusInOut;
-		Java_sun_awt_motif_MEmbeddedFramePeer_pReshapePrivate;
-		Java_sun_awt_motif_MEmbeddedFramePeer_getBoundsPrivate;
-		Java_sun_awt_motif_MEmbeddedFrame_getWidget;
-		Java_sun_awt_motif_MEmbeddedFrame_mapWidget;
-                Java_sun_awt_motif_MEmbedCanvasPeer_forwardEventToEmbedded;       
-		Java_sun_awt_motif_MFramePeer_pSetIconImage___3B_3I_3SII;
-		Java_sun_awt_motif_MFileDialogPeer_create;
-		Java_sun_awt_motif_MFileDialogPeer_pDispose;
-		Java_sun_awt_motif_MFileDialogPeer_pHide;
-		Java_sun_awt_motif_MFileDialogPeer_pReshape;
-		Java_sun_awt_motif_MFileDialogPeer_pShow;
-		Java_sun_awt_motif_MFileDialogPeer_setFileEntry;
-		Java_sun_awt_motif_MFileDialogPeer_setFont;
-		Java_sun_awt_motif_MFramePeer_pGetIconSize;
-		Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
-		Java_sun_awt_motif_MGlobalCursorManager_findComponentAt;
-		Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
-		Java_sun_awt_motif_MGlobalCursorManager_getCursorPos;
-		Java_sun_awt_motif_MGlobalCursorManager_getLocationOnScreen;
-		Java_sun_awt_motif_MLabelPeer_create;
-		Java_sun_awt_motif_MLabelPeer_setAlignment;
-		Java_sun_awt_motif_MLabelPeer_setText;
-		Java_sun_awt_motif_MListPeer_addItem;
-		Java_sun_awt_motif_MListPeer_create;
-		Java_sun_awt_motif_MListPeer_delItems;
-		Java_sun_awt_motif_MListPeer_deselect;
-		Java_sun_awt_motif_MListPeer_isSelected;
-		Java_sun_awt_motif_MListPeer_makeVisible;
-		Java_sun_awt_motif_MListPeer_nativeHandleMouseWheel;
-		Java_sun_awt_motif_MListPeer_select;
-		Java_sun_awt_motif_MListPeer_setMultipleSelections;
-		Java_sun_awt_motif_MMenuBarPeer_create;
-		Java_sun_awt_motif_MMenuItemPeer_createMenuItem;
-		Java_sun_awt_motif_MMenuItemPeer_pDisable;
-		Java_sun_awt_motif_MMenuItemPeer_pDispose;
-		Java_sun_awt_motif_MMenuItemPeer_pEnable;
-		Java_sun_awt_motif_MMenuItemPeer_pSetLabel;
-		Java_sun_awt_motif_MMenuPeer_createMenu;
-		Java_sun_awt_motif_MMenuPeer_createSubMenu;
-		Java_sun_awt_motif_MMenuPeer_pDispose;
-		Java_sun_awt_motif_MPopupMenuPeer_createMenu;
-		Java_sun_awt_motif_MPopupMenuPeer_pDispose;
-		Java_sun_awt_motif_MPopupMenuPeer_pShow;
-		Java_sun_awt_motif_MRobotPeer_getRGBPixelsImpl;
-		Java_sun_awt_motif_MRobotPeer_keyPressImpl;
-		Java_sun_awt_motif_MRobotPeer_keyReleaseImpl;
-		Java_sun_awt_motif_MRobotPeer_mouseMoveImpl;
-		Java_sun_awt_motif_MRobotPeer_mousePressImpl;
-		Java_sun_awt_motif_MRobotPeer_mouseReleaseImpl;
-		Java_sun_awt_motif_MRobotPeer_mouseWheelImpl;
-		Java_sun_awt_motif_MRobotPeer_setup;
-		Java_sun_awt_motif_MScrollbarPeer_create;
-		Java_sun_awt_motif_MScrollbarPeer_setLineIncrement;
-		Java_sun_awt_motif_MScrollbarPeer_setPageIncrement;
-		Java_sun_awt_motif_MScrollbarPeer_pSetValues;
-		Java_sun_awt_motif_MScrollPanePeer_create;
-		Java_sun_awt_motif_MScrollPanePeer_pGetBlockIncrement;
-		Java_sun_awt_motif_MScrollPanePeer_pGetScrollbarSpace;
-		Java_sun_awt_motif_MScrollPanePeer_pGetShadow;
-		Java_sun_awt_motif_MScrollPanePeer_pInsets;
-		Java_sun_awt_motif_MScrollPanePeer_pSetIncrement;
-		Java_sun_awt_motif_MScrollPanePeer_pSetScrollChild;
-		Java_sun_awt_motif_MScrollPanePeer_setScrollPosition;
-		Java_sun_awt_motif_MScrollPanePeer_setTypedValue;
-		Java_sun_awt_motif_MTextAreaPeer_initIDs;
-		Java_sun_awt_motif_MTextAreaPeer_pCreate;
-		Java_sun_awt_motif_MTextAreaPeer_getCaretPosition;
-		Java_sun_awt_motif_MTextAreaPeer_getExtraHeight;
-		Java_sun_awt_motif_MTextAreaPeer_getExtraWidth;
-		Java_sun_awt_motif_MTextAreaPeer_getSelectionEnd;
-		Java_sun_awt_motif_MTextAreaPeer_getSelectionStart;
-		Java_sun_awt_motif_MTextAreaPeer_getText;
-		Java_sun_awt_motif_MTextAreaPeer_insert;
-		Java_sun_awt_motif_MTextAreaPeer_nativeHandleMouseWheel;
-		Java_sun_awt_motif_MTextAreaPeer_pMakeCursorVisible;
-		Java_sun_awt_motif_MTextAreaPeer_pSetEditable;
-		Java_sun_awt_motif_MTextAreaPeer_pShow2;
-		Java_sun_awt_motif_MTextAreaPeer_replaceRange;
-		Java_sun_awt_motif_MTextAreaPeer_select;
-		Java_sun_awt_motif_MTextAreaPeer_setCaretPosition;
-		Java_sun_awt_motif_MTextAreaPeer_setFont;
-		Java_sun_awt_motif_MTextAreaPeer_setText;
-		Java_sun_awt_motif_MTextAreaPeer_setTextBackground;
-		Java_sun_awt_motif_MTextFieldPeer_initIDs;
-		Java_sun_awt_motif_MTextFieldPeer_pCreate;
-		Java_sun_awt_motif_MTextFieldPeer_getCaretPosition;
-		Java_sun_awt_motif_MTextFieldPeer_getSelectionEnd;
-		Java_sun_awt_motif_MTextFieldPeer_getSelectionStart;
-		Java_sun_awt_motif_MTextFieldPeer_getText;
-		Java_sun_awt_motif_MTextFieldPeer_insertReplaceText;
-		Java_sun_awt_motif_MTextFieldPeer_preDispose;
-		Java_sun_awt_motif_MTextFieldPeer_pSetEditable;
-		Java_sun_awt_motif_MTextFieldPeer_select;
-		Java_sun_awt_motif_MTextFieldPeer_setCaretPosition;
-		Java_sun_awt_motif_MTextFieldPeer_setEchoChar;
-		Java_sun_awt_motif_MTextFieldPeer_setFont;
-		Java_sun_awt_motif_MTextFieldPeer_setText;
+		#Java_sun_awt_motif_MButtonPeer_create;
+		#Java_sun_awt_motif_MButtonPeer_setLabel;
+                #Java_sun_awt_motif_MPanelPeer_pEnsureIndex;
+                #Java_sun_awt_motif_MPanelPeer_pRestack;
+		#Java_sun_awt_motif_MCanvasPeer_create;
+		#Java_sun_awt_motif_MCanvasPeer_initIDs;
+		#Java_sun_awt_motif_MCanvasPeer_resetTargetGC;
+		#Java_sun_awt_motif_MCheckboxMenuItemPeer_pSetState;
+		#Java_sun_awt_motif_MCheckboxPeer_create;
+		#Java_sun_awt_motif_MCheckboxPeer_setCheckboxGroup;
+		#Java_sun_awt_motif_MCheckboxPeer_setLabel;
+		#Java_sun_awt_motif_MCheckboxPeer_pSetState;
+		#Java_sun_awt_motif_MCheckboxPeer_pGetState;
+		#Java_sun_awt_motif_MChoicePeer_addItem;
+		#Java_sun_awt_motif_MChoicePeer_appendItems;
+		#Java_sun_awt_motif_MChoicePeer_create;
+		#Java_sun_awt_motif_MChoicePeer_pReshape;
+		#Java_sun_awt_motif_MChoicePeer_remove;
+		#Java_sun_awt_motif_MChoicePeer_removeAll;
+		#Java_sun_awt_motif_MChoicePeer_setBackground;
+		#Java_sun_awt_motif_MChoicePeer_pSelect;
+		#Java_sun_awt_motif_MChoicePeer_setFont;
+		#Java_sun_awt_motif_MChoicePeer_setForeground;
+		#Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
+		#Java_sun_awt_motif_MComponentPeer_getNativeColor;
+		#Java_sun_awt_motif_MComponentPeer_getWindow;
+		#Java_sun_awt_motif_MComponentPeer_pDisable;
+		#Java_sun_awt_motif_MComponentPeer_pDispose;
+		#Java_sun_awt_motif_MComponentPeer_pEnable;
+		#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen;
+		#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen2;
+		#Java_sun_awt_motif_MComponentPeer_pHide;
+		#Java_sun_awt_motif_MComponentPeer_pInitialize;
+		#Java_sun_awt_motif_MComponentPeer_pMakeCursorVisible;
+		#Java_sun_awt_motif_MComponentPeer_pReshape;
+		#Java_sun_awt_motif_MComponentPeer_pShow;
+		#Java_sun_awt_motif_MComponentPeer_removeNativeDropTarget;
+		#Java_sun_awt_motif_MComponentPeer_pSetBackground;
+		#Java_sun_awt_motif_MComponentPeer_pSetFont;
+                #Java_sun_awt_motif_MComponentPeer_processSynchronousLightweightTransfer;
+                #Java_sun_awt_motif_MComponentPeer__1requestFocus;
+                #Java_sun_awt_motif_MComponentPeer_getNativeFocusedWindow;
+		#Java_sun_awt_motif_MCheckboxMenuItemPeer_getState;
+		#Java_sun_awt_motif_MComponentPeer_pSetForeground;
+		#Java_sun_awt_motif_MDragSourceContextPeer_startDrag;
+		#Java_sun_awt_motif_MDragSourceContextPeer_setNativeCursor;
+		#Java_sun_awt_motif_MDropTargetContextPeer_addTransfer;
+		#Java_sun_awt_motif_MDropTargetContextPeer_dropDone;
+		#Java_sun_awt_motif_MDropTargetContextPeer_startTransfer;
+		#Java_sun_awt_motif_X11DragSourceContextPeer_startDrag;
+		#Java_sun_awt_motif_X11DragSourceContextPeer_setNativeCursor;
+		#Java_sun_awt_motif_X11DropTargetContextPeer_sendResponse;
+		#Java_sun_awt_motif_X11DropTargetContextPeer_dropDone;
+		#Java_sun_awt_motif_X11DropTargetContextPeer_getData;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_NEFcreate;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_pShowImpl;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_requestXEmbedFocus;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedApplicationActive;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedActive;
+                #Java_sun_awt_motif_MEmbeddedFramePeer_synthesizeFocusInOut;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_pReshapePrivate;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_getBoundsPrivate;
+		#Java_sun_awt_motif_MEmbeddedFrame_getWidget;
+		#Java_sun_awt_motif_MEmbeddedFrame_mapWidget;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_forwardEventToEmbedded;       
+		#Java_sun_awt_motif_MFramePeer_pSetIconImage___3B_3I_3SII;
+		#Java_sun_awt_motif_MFileDialogPeer_create;
+		#Java_sun_awt_motif_MFileDialogPeer_pDispose;
+		#Java_sun_awt_motif_MFileDialogPeer_pHide;
+		#Java_sun_awt_motif_MFileDialogPeer_pReshape;
+		#Java_sun_awt_motif_MFileDialogPeer_pShow;
+		#Java_sun_awt_motif_MFileDialogPeer_setFileEntry;
+		#Java_sun_awt_motif_MFileDialogPeer_setFont;
+		#Java_sun_awt_motif_MFramePeer_pGetIconSize;
+		#Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
+		#Java_sun_awt_motif_MGlobalCursorManager_findComponentAt;
+		#Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
+		#Java_sun_awt_motif_MGlobalCursorManager_getCursorPos;
+		#Java_sun_awt_motif_MGlobalCursorManager_getLocationOnScreen;
+		#Java_sun_awt_motif_MLabelPeer_create;
+		#Java_sun_awt_motif_MLabelPeer_setAlignment;
+		#Java_sun_awt_motif_MLabelPeer_setText;
+		#Java_sun_awt_motif_MListPeer_addItem;
+		#Java_sun_awt_motif_MListPeer_create;
+		#Java_sun_awt_motif_MListPeer_delItems;
+		#Java_sun_awt_motif_MListPeer_deselect;
+		#Java_sun_awt_motif_MListPeer_isSelected;
+		#Java_sun_awt_motif_MListPeer_makeVisible;
+		#Java_sun_awt_motif_MListPeer_nativeHandleMouseWheel;
+		#Java_sun_awt_motif_MListPeer_select;
+		#Java_sun_awt_motif_MListPeer_setMultipleSelections;
+		#Java_sun_awt_motif_MMenuBarPeer_create;
+		#Java_sun_awt_motif_MMenuItemPeer_createMenuItem;
+		#Java_sun_awt_motif_MMenuItemPeer_pDisable;
+		#Java_sun_awt_motif_MMenuItemPeer_pDispose;
+		#Java_sun_awt_motif_MMenuItemPeer_pEnable;
+		#Java_sun_awt_motif_MMenuItemPeer_pSetLabel;
+		#Java_sun_awt_motif_MMenuPeer_createMenu;
+		#Java_sun_awt_motif_MMenuPeer_createSubMenu;
+		#Java_sun_awt_motif_MMenuPeer_pDispose;
+		#Java_sun_awt_motif_MPopupMenuPeer_createMenu;
+		#Java_sun_awt_motif_MPopupMenuPeer_pDispose;
+		#Java_sun_awt_motif_MPopupMenuPeer_pShow;
+		#Java_sun_awt_motif_MRobotPeer_getRGBPixelsImpl;
+		#Java_sun_awt_motif_MRobotPeer_keyPressImpl;
+		#Java_sun_awt_motif_MRobotPeer_keyReleaseImpl;
+		#Java_sun_awt_motif_MRobotPeer_mouseMoveImpl;
+		#Java_sun_awt_motif_MRobotPeer_mousePressImpl;
+		#Java_sun_awt_motif_MRobotPeer_mouseReleaseImpl;
+		#Java_sun_awt_motif_MRobotPeer_mouseWheelImpl;
+		#Java_sun_awt_motif_MRobotPeer_setup;
+		#Java_sun_awt_motif_MScrollbarPeer_create;
+		#Java_sun_awt_motif_MScrollbarPeer_setLineIncrement;
+		#Java_sun_awt_motif_MScrollbarPeer_setPageIncrement;
+		#Java_sun_awt_motif_MScrollbarPeer_pSetValues;
+		#Java_sun_awt_motif_MScrollPanePeer_create;
+		#Java_sun_awt_motif_MScrollPanePeer_pGetBlockIncrement;
+		#Java_sun_awt_motif_MScrollPanePeer_pGetScrollbarSpace;
+		#Java_sun_awt_motif_MScrollPanePeer_pGetShadow;
+		#Java_sun_awt_motif_MScrollPanePeer_pInsets;
+		#Java_sun_awt_motif_MScrollPanePeer_pSetIncrement;
+		#Java_sun_awt_motif_MScrollPanePeer_pSetScrollChild;
+		#Java_sun_awt_motif_MScrollPanePeer_setScrollPosition;
+		#Java_sun_awt_motif_MScrollPanePeer_setTypedValue;
+		#Java_sun_awt_motif_MTextAreaPeer_initIDs;
+		#Java_sun_awt_motif_MTextAreaPeer_pCreate;
+		#Java_sun_awt_motif_MTextAreaPeer_getCaretPosition;
+		#Java_sun_awt_motif_MTextAreaPeer_getExtraHeight;
+		#Java_sun_awt_motif_MTextAreaPeer_getExtraWidth;
+		#Java_sun_awt_motif_MTextAreaPeer_getSelectionEnd;
+		#Java_sun_awt_motif_MTextAreaPeer_getSelectionStart;
+		#Java_sun_awt_motif_MTextAreaPeer_getText;
+		#Java_sun_awt_motif_MTextAreaPeer_insert;
+		#Java_sun_awt_motif_MTextAreaPeer_nativeHandleMouseWheel;
+		#Java_sun_awt_motif_MTextAreaPeer_pMakeCursorVisible;
+		#Java_sun_awt_motif_MTextAreaPeer_pSetEditable;
+		#Java_sun_awt_motif_MTextAreaPeer_pShow2;
+		#Java_sun_awt_motif_MTextAreaPeer_replaceRange;
+		#Java_sun_awt_motif_MTextAreaPeer_select;
+                #Java_sun_awt_motif_MTextAreaPeer_setCaretPosition;
+		#Java_sun_awt_motif_MTextAreaPeer_setFont;
+		#Java_sun_awt_motif_MTextAreaPeer_setText;
+		#Java_sun_awt_motif_MTextAreaPeer_setTextBackground;
+		#Java_sun_awt_motif_MTextFieldPeer_initIDs;
+		#Java_sun_awt_motif_MTextFieldPeer_pCreate;
+		#Java_sun_awt_motif_MTextFieldPeer_getCaretPosition;
+		#Java_sun_awt_motif_MTextFieldPeer_getSelectionEnd;
+		#Java_sun_awt_motif_MTextFieldPeer_getSelectionStart;
+		#Java_sun_awt_motif_MTextFieldPeer_getText;
+		#Java_sun_awt_motif_MTextFieldPeer_insertReplaceText;
+		#Java_sun_awt_motif_MTextFieldPeer_preDispose;
+		#Java_sun_awt_motif_MTextFieldPeer_pSetEditable;
+		#Java_sun_awt_motif_MTextFieldPeer_select;
+		#Java_sun_awt_motif_MTextFieldPeer_setCaretPosition;
+		#Java_sun_awt_motif_MTextFieldPeer_setEchoChar;
+		#Java_sun_awt_motif_MTextFieldPeer_setFont;
+		#Java_sun_awt_motif_MTextFieldPeer_setText;
 		Java_sun_awt_motif_MToolkit_beep;
 		Java_sun_awt_motif_MToolkit_getLockingKeyStateNative;
 		Java_sun_awt_motif_MToolkit_getMulticlickTime;
@@ -236,30 +236,30 @@
                 Java_sun_awt_motif_MToolkit_nativeGrab;
                 Java_sun_awt_motif_MToolkit_getWMName;
 		Java_sun_awt_motif_MWindowAttributes_initIDs;
-		Java_sun_awt_motif_MWindowPeer_pDispose;
-		Java_sun_awt_motif_MWindowPeer_pHide;
-		Java_sun_awt_motif_MWindowPeer_pReshape;
-		Java_sun_awt_motif_MWindowPeer_pSetTitle;
-		Java_sun_awt_motif_MWindowPeer_pShow;
-		Java_sun_awt_motif_MWindowPeer_setResizable;
-		Java_sun_awt_motif_MWindowPeer_toBack;
-		Java_sun_awt_motif_MWindowPeer_addTextComponentNative;
-		Java_sun_awt_motif_MWindowPeer_getState;
-		Java_sun_awt_motif_MWindowPeer_pSetIMMOption;
-		Java_sun_awt_motif_MWindowPeer_pSetMenuBar;
-		Java_sun_awt_motif_MWindowPeer_pShowModal;
-		Java_sun_awt_motif_MWindowPeer_removeTextComponentNative;
-		Java_sun_awt_motif_MWindowPeer_setSaveUnder;
-		Java_sun_awt_motif_MWindowPeer_setState;
-		Java_sun_awt_motif_MWindowPeer_resetTargetGC;
-		Java_sun_awt_motif_MWindowPeer_registerX11DropTarget;
-		Java_sun_awt_motif_MWindowPeer_unregisterX11DropTarget;
-		Java_sun_awt_motif_MWindowPeer_updateAlwaysOnTop;
-                Java_sun_awt_motif_MWindowPeer_setFocusableWindow;
-                Java_sun_awt_motif_MWindowPeer_pToFront;
-		Java_sun_awt_motif_MCustomCursor_cacheInit;
-		Java_sun_awt_motif_MCustomCursor_createCursor;
-		Java_sun_awt_motif_MCustomCursor_queryBestCursor;
+		#Java_sun_awt_motif_MWindowPeer_pDispose;
+		#Java_sun_awt_motif_MWindowPeer_pHide;
+		#Java_sun_awt_motif_MWindowPeer_pReshape;
+		#Java_sun_awt_motif_MWindowPeer_pSetTitle;
+		#Java_sun_awt_motif_MWindowPeer_pShow;
+		#Java_sun_awt_motif_MWindowPeer_setResizable;
+		#Java_sun_awt_motif_MWindowPeer_toBack;
+		#Java_sun_awt_motif_MWindowPeer_addTextComponentNative;
+		#Java_sun_awt_motif_MWindowPeer_getState;
+		#Java_sun_awt_motif_MWindowPeer_pSetIMMOption;
+		#Java_sun_awt_motif_MWindowPeer_pSetMenuBar;
+		#Java_sun_awt_motif_MWindowPeer_pShowModal;
+		#Java_sun_awt_motif_MWindowPeer_removeTextComponentNative;
+		#Java_sun_awt_motif_MWindowPeer_setSaveUnder;
+		#Java_sun_awt_motif_MWindowPeer_setState;
+		#Java_sun_awt_motif_MWindowPeer_resetTargetGC;
+		#Java_sun_awt_motif_MWindowPeer_registerX11DropTarget;
+		#Java_sun_awt_motif_MWindowPeer_unregisterX11DropTarget;
+		#Java_sun_awt_motif_MWindowPeer_updateAlwaysOnTop;
+                #Java_sun_awt_motif_MWindowPeer_setFocusableWindow;
+                #Java_sun_awt_motif_MWindowPeer_pToFront;
+		#Java_sun_awt_motif_MCustomCursor_cacheInit;
+		#Java_sun_awt_motif_MCustomCursor_createCursor;
+		#Java_sun_awt_motif_MCustomCursor_queryBestCursor;
 		Java_sun_awt_motif_X11FontMetrics_bytesWidth;
 		Java_sun_awt_motif_X11FontMetrics_getMFCharsWidth;
 		Java_sun_awt_motif_X11FontMetrics_init;
@@ -268,18 +268,18 @@
 		Java_sun_awt_X11InputMethod_resetXIC;
 		Java_sun_awt_X11InputMethod_setCompositionEnabledNative;
 		Java_sun_awt_X11InputMethod_turnoffStatusWindow;
-		Java_sun_awt_motif_MInputMethod_openXIMNative;
-		Java_sun_awt_motif_MInputMethod_configureStatusAreaNative;
-		Java_sun_awt_motif_MInputMethod_createXICNative;
-		Java_sun_awt_motif_MInputMethod_reconfigureXICNative;
-		Java_sun_awt_motif_MInputMethod_setXICFocusNative;
-		Java_sun_awt_motif_X11Clipboard_getClipboardData;
-		Java_sun_awt_motif_X11Clipboard_getClipboardFormats;
-		Java_sun_awt_motif_X11Clipboard_registerClipboardViewer;
-		Java_sun_awt_motif_X11Clipboard_unregisterClipboardViewer;
-		Java_sun_awt_motif_X11Selection_init;
-		Java_sun_awt_motif_X11Selection_pGetSelectionOwnership;
-		Java_sun_awt_motif_X11Selection_clearNativeContext;
+		#Java_sun_awt_motif_MInputMethod_openXIMNative;
+		#Java_sun_awt_motif_MInputMethod_configureStatusAreaNative;
+		#Java_sun_awt_motif_MInputMethod_createXICNative;
+		#Java_sun_awt_motif_MInputMethod_reconfigureXICNative;
+		#Java_sun_awt_motif_MInputMethod_setXICFocusNative;
+		#Java_sun_awt_motif_X11Clipboard_getClipboardData;
+		#Java_sun_awt_motif_X11Clipboard_getClipboardFormats;
+		#Java_sun_awt_motif_X11Clipboard_registerClipboardViewer;
+		#Java_sun_awt_motif_X11Clipboard_unregisterClipboardViewer;
+		#Java_sun_awt_motif_X11Selection_init;
+		#Java_sun_awt_motif_X11Selection_pGetSelectionOwnership;
+		#Java_sun_awt_motif_X11Selection_clearNativeContext;
 		Java_sun_awt_SunToolkit_closeSplashScreen;
 		Java_sun_awt_PlatformFont_initIDs;
 		Java_sun_awt_X11GraphicsConfig_init;
@@ -311,25 +311,25 @@
                 Java_sun_awt_X11GraphicsEnvironment_initGLX;
 		Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama;
 		Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint;
-                Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer;
-                Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer;
-                Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive;
-                Java_sun_awt_motif_MEmbedCanvasPeer_initDispatching;
-                Java_sun_awt_motif_MEmbedCanvasPeer_endDispatching;
-                Java_sun_awt_motif_MEmbedCanvasPeer_embedChild;
-                Java_sun_awt_motif_MEmbedCanvasPeer_childDestroyed;
-                Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedPreferredSize;
-                Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedMinimumSize;
-                Java_sun_awt_motif_MEmbedCanvasPeer_getClientBounds;
-                Java_sun_awt_motif_MEmbedCanvasPeer_notifyChildEmbedded;
-                Java_sun_awt_motif_MEmbedCanvasPeer_detachChild;
-                Java_sun_awt_motif_MEmbedCanvasPeer_forwardKeyEvent;
-                Java_sun_awt_motif_MEmbedCanvasPeer_getAWTKeyCodeForKeySym;
-                Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__I;
-                Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__IJJJ;
-                Java_sun_awt_motif_MEmbedCanvasPeer_getWindow;       
-                Java_sun_awt_motif_GrabbedKey_initKeySymAndModifiers;
-                Java_sun_awt_motif_MEmbeddedFramePeer_traverseOut;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_initDispatching;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_endDispatching;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_embedChild;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_childDestroyed;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedPreferredSize;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedMinimumSize;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_getClientBounds;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_notifyChildEmbedded;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_detachChild;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_forwardKeyEvent;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_getAWTKeyCodeForKeySym;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__I;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__IJJJ;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_getWindow;       
+                #Java_sun_awt_motif_GrabbedKey_initKeySymAndModifiers;
+                #Java_sun_awt_motif_MEmbeddedFramePeer_traverseOut;
 		Java_java_awt_AWTEvent_initIDs;
 		Java_java_awt_Button_initIDs;
 		Java_java_awt_Container_initIDs;
@@ -343,39 +343,39 @@
 		Java_java_awt_Insets_initIDs;
 		Java_java_awt_TextField_initIDs;
 		Java_java_awt_Window_initIDs;
-		Java_sun_awt_motif_MCheckboxPeer_getIndicatorSize;
-		Java_sun_awt_motif_MCheckboxPeer_getSpacing;
-		Java_sun_awt_motif_MChoicePeer_freeNativeData;
-		Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
-		Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
-		Java_sun_awt_motif_MComponentPeer_initIDs;
-		Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
-		Java_sun_awt_motif_MComponentPeer_pSetCursor;
-		Java_sun_awt_motif_MComponentPeer_pSetInnerForeground;
-		Java_sun_awt_motif_MComponentPeer_pSetScrollbarBackground;
-		Java_sun_awt_motif_MComponentPeer_setTargetBackground;
-		Java_sun_awt_motif_MDataTransferer_dragQueryFile;
-		Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
-		Java_sun_awt_motif_MDataTransferer_getTargetNameForAtom;
-		Java_sun_awt_motif_MFileDialogPeer_insertReplaceFileDialogText;
+		#Java_sun_awt_motif_MCheckboxPeer_getIndicatorSize;
+		#Java_sun_awt_motif_MCheckboxPeer_getSpacing;
+		#Java_sun_awt_motif_MChoicePeer_freeNativeData;
+		#Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
+		#Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
+		#Java_sun_awt_motif_MComponentPeer_initIDs;
+		#Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
+		#Java_sun_awt_motif_MComponentPeer_pSetCursor;
+		#Java_sun_awt_motif_MComponentPeer_pSetInnerForeground;
+		#Java_sun_awt_motif_MComponentPeer_pSetScrollbarBackground;
+		#Java_sun_awt_motif_MComponentPeer_setTargetBackground;
+		#Java_sun_awt_motif_MDataTransferer_dragQueryFile;
+		#Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
+		#Java_sun_awt_motif_MDataTransferer_getTargetNameForAtom;
+		#Java_sun_awt_motif_MFileDialogPeer_insertReplaceFileDialogText;
 		Java_sun_awt_motif_MFontPeer_initIDs;
-		Java_sun_awt_motif_MListPeer_setBackground;
-		Java_sun_awt_motif_MMenuBarPeer_initIDs;
-		Java_sun_awt_motif_MMenuBarPeer_pDispose;
-		Java_sun_awt_motif_MMenuItemPeer_getParent_1NoClientCode;
-		Java_sun_awt_motif_MMenuItemPeer_initIDs;
-		Java_sun_awt_motif_MMenuItemPeer_pSetShortcut;
-		Java_sun_awt_motif_MPopupMenuPeer_initIDs;
-		Java_sun_awt_motif_MScrollbarPeer_initIDs;
-		Java_sun_awt_motif_MScrollPanePeer_initIDs;
-		Java_sun_awt_motif_MTextAreaPeer_pSetCursor;
+		#Java_sun_awt_motif_MListPeer_setBackground;
+		#Java_sun_awt_motif_MMenuBarPeer_initIDs;
+		#Java_sun_awt_motif_MMenuBarPeer_pDispose;
+		#Java_sun_awt_motif_MMenuItemPeer_getParent_1NoClientCode;
+		#Java_sun_awt_motif_MMenuItemPeer_initIDs;
+		#Java_sun_awt_motif_MMenuItemPeer_pSetShortcut;
+		#Java_sun_awt_motif_MPopupMenuPeer_initIDs;
+		#Java_sun_awt_motif_MScrollbarPeer_initIDs;
+		#Java_sun_awt_motif_MScrollPanePeer_initIDs;
+		#Java_sun_awt_motif_MTextAreaPeer_pSetCursor;
 		Java_sun_awt_motif_MToolkit_shutdown;
-		Java_sun_awt_motif_MWindowPeer_initIDs;
-		Java_sun_awt_motif_MWindowPeer_pCreate;
-		Java_sun_awt_motif_MWindowPeer_wrapInSequenced;
+		#Java_sun_awt_motif_MWindowPeer_initIDs;
+		#Java_sun_awt_motif_MWindowPeer_pCreate;
+		#Java_sun_awt_motif_MWindowPeer_wrapInSequenced;
 		Java_sun_awt_motif_X11FontMetrics_initIDs;
-		Java_sun_awt_X11InputMethod_initIDs;
-		Java_sun_awt_motif_X11Selection_initIDs;
+		#Java_sun_awt_X11InputMethod_initIDs;
+		#Java_sun_awt_motif_X11Selection_initIDs;
 		Java_sun_awt_motif_MToolkitThreadBlockedHandler_enter;
 		Java_sun_awt_motif_MToolkitThreadBlockedHandler_exit;
 		Java_sun_awt_X11GraphicsConfig_init;
--- a/jdk/make/sun/awt/mapfile-vers-linux	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/sun/awt/mapfile-vers-linux	Wed Jul 05 16:41:34 2017 +0200
@@ -170,7 +170,7 @@
 		GrPrim_Sg2dGetPixel;
 		GrPrim_Sg2dGetLCDTextContrast;
 
-		Java_sun_awt_motif_MComponentPeer_restoreFocus;
+		#Java_sun_awt_motif_MComponentPeer_restoreFocus;
 		Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords;
 		Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse;
 		Java_java_awt_AWTEvent_nativeSetSource;
@@ -189,158 +189,158 @@
 		Java_java_awt_ScrollPane_initIDs;
 		Java_java_awt_TextArea_initIDs;
 		Java_sun_awt_FontDescriptor_initIDs;
-		Java_sun_awt_motif_MButtonPeer_create;
-		Java_sun_awt_motif_MButtonPeer_setLabel;
-		Java_sun_awt_motif_MCanvasPeer_create;
-		Java_sun_awt_motif_MCanvasPeer_initIDs;
-		Java_sun_awt_motif_MCanvasPeer_resetTargetGC;
-		Java_sun_awt_motif_MCheckboxMenuItemPeer_pSetState;
-		Java_sun_awt_motif_MCheckboxPeer_create;
-		Java_sun_awt_motif_MCheckboxPeer_setCheckboxGroup;
-		Java_sun_awt_motif_MCheckboxPeer_setLabel;
-		Java_sun_awt_motif_MCheckboxPeer_pSetState;
-		Java_sun_awt_motif_MCheckboxPeer_pGetState;
-		Java_sun_awt_motif_MChoicePeer_addItem;
-		Java_sun_awt_motif_MChoicePeer_appendItems;
-		Java_sun_awt_motif_MChoicePeer_create;
-		Java_sun_awt_motif_MChoicePeer_pReshape;
-		Java_sun_awt_motif_MChoicePeer_remove;
-		Java_sun_awt_motif_MChoicePeer_removeAll;
-		Java_sun_awt_motif_MChoicePeer_setBackground;
-		Java_sun_awt_motif_MChoicePeer_pSelect;
-		Java_sun_awt_motif_MChoicePeer_setFont;
-		Java_sun_awt_motif_MChoicePeer_setForeground;
-		Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
-		Java_sun_awt_motif_MComponentPeer_createBackBuffer;
-		Java_sun_awt_motif_MComponentPeer_destroyBackBuffer;
-		Java_sun_awt_motif_MComponentPeer_getNativeColor;
-		Java_sun_awt_motif_MComponentPeer_getWindow;
-		Java_sun_awt_motif_MComponentPeer_pDisable;
-		Java_sun_awt_motif_MComponentPeer_pDispose;
-		Java_sun_awt_motif_MComponentPeer_pEnable;
-		Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen;
-		Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen2;
-		Java_sun_awt_motif_MComponentPeer_pHide;
-		Java_sun_awt_motif_MComponentPeer_pInitialize;
-		Java_sun_awt_motif_MComponentPeer_pMakeCursorVisible;
-		Java_sun_awt_motif_MComponentPeer_pReshape;
-		Java_sun_awt_motif_MComponentPeer_pShow;
-		Java_sun_awt_motif_MComponentPeer_removeNativeDropTarget;
-		Java_sun_awt_motif_MComponentPeer_swapBuffers;
-		Java_sun_awt_motif_MComponentPeer_pSetBackground;
-		Java_sun_awt_motif_MComponentPeer_pSetFont;
-                Java_sun_awt_motif_MComponentPeer_processSynchronousLightweightTransfer;
-                Java_sun_awt_motif_MComponentPeer__1requestFocus;
-		Java_sun_awt_motif_MCheckboxMenuItemPeer_getState;
-		Java_sun_awt_motif_MComponentPeer_pSetForeground;
-		Java_sun_awt_motif_MDragSourceContextPeer_startDrag;
-		Java_sun_awt_motif_MDragSourceContextPeer_setNativeCursor;
-		Java_sun_awt_motif_MDropTargetContextPeer_addTransfer;
-		Java_sun_awt_motif_MDropTargetContextPeer_dropDone;
-		Java_sun_awt_motif_MDropTargetContextPeer_startTransfer;
-		Java_sun_awt_motif_X11DragSourceContextPeer_startDrag;
-		Java_sun_awt_motif_X11DragSourceContextPeer_setNativeCursor;
-		Java_sun_awt_motif_X11DropTargetContextPeer_sendResponse;
-		Java_sun_awt_motif_X11DropTargetContextPeer_dropDone;
-		Java_sun_awt_motif_X11DropTargetContextPeer_getData;
-		Java_sun_awt_motif_MEmbeddedFramePeer_NEFcreate;
-		Java_sun_awt_motif_MEmbeddedFramePeer_pShowImpl;
-		Java_sun_awt_motif_MEmbeddedFramePeer_pReshapePrivate;
-		Java_sun_awt_motif_MEmbeddedFramePeer_getBoundsPrivate;
-		Java_sun_awt_motif_MFramePeer_pSetIconImage___3B_3I_3SII;
-		Java_sun_awt_motif_MEmbeddedFramePeer_requestXEmbedFocus;
-		Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedApplicationActive;
-		Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedActive;
-		Java_sun_awt_motif_MEmbeddedFrame_getWidget;
-		Java_sun_awt_motif_MEmbeddedFrame_mapWidget;
-		Java_sun_awt_motif_MFileDialogPeer_create;
-		Java_sun_awt_motif_MFileDialogPeer_pDispose;
-		Java_sun_awt_motif_MFileDialogPeer_pHide;
-		Java_sun_awt_motif_MFileDialogPeer_pReshape;
-		Java_sun_awt_motif_MFileDialogPeer_pShow;
-		Java_sun_awt_motif_MFileDialogPeer_setFileEntry;
-		Java_sun_awt_motif_MFileDialogPeer_setFont;
-		Java_sun_awt_motif_MFramePeer_pGetIconSize;
-		Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
-		Java_sun_awt_motif_MGlobalCursorManager_findComponentAt;
-		Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
-		Java_sun_awt_motif_MGlobalCursorManager_getCursorPos;
-		Java_sun_awt_motif_MGlobalCursorManager_getLocationOnScreen;
-		Java_sun_awt_motif_MLabelPeer_create;
-		Java_sun_awt_motif_MLabelPeer_setAlignment;
-		Java_sun_awt_motif_MLabelPeer_setText;
-		Java_sun_awt_motif_MListPeer_addItem;
-		Java_sun_awt_motif_MListPeer_create;
-		Java_sun_awt_motif_MListPeer_delItems;
-		Java_sun_awt_motif_MListPeer_deselect;
-		Java_sun_awt_motif_MListPeer_isSelected;
-		Java_sun_awt_motif_MListPeer_makeVisible;
-		Java_sun_awt_motif_MListPeer_select;
-		Java_sun_awt_motif_MListPeer_setMultipleSelections;
-		Java_sun_awt_motif_MMenuBarPeer_create;
-		Java_sun_awt_motif_MMenuItemPeer_createMenuItem;
-		Java_sun_awt_motif_MMenuItemPeer_pDisable;
-		Java_sun_awt_motif_MMenuItemPeer_pDispose;
-		Java_sun_awt_motif_MMenuItemPeer_pEnable;
-		Java_sun_awt_motif_MMenuItemPeer_pSetLabel;
-		Java_sun_awt_motif_MMenuPeer_createMenu;
-		Java_sun_awt_motif_MMenuPeer_createSubMenu;
-		Java_sun_awt_motif_MMenuPeer_pDispose;
-		Java_sun_awt_motif_MPopupMenuPeer_createMenu;
-		Java_sun_awt_motif_MPopupMenuPeer_pDispose;
-		Java_sun_awt_motif_MPopupMenuPeer_pShow;
-		Java_sun_awt_motif_MRobotPeer_getRGBPixelsImpl;
-		Java_sun_awt_motif_MRobotPeer_keyPressImpl;
-		Java_sun_awt_motif_MRobotPeer_keyReleaseImpl;
-		Java_sun_awt_motif_MRobotPeer_mouseMoveImpl;
-		Java_sun_awt_motif_MRobotPeer_mousePressImpl;
-		Java_sun_awt_motif_MRobotPeer_mouseReleaseImpl;
-		Java_sun_awt_motif_MRobotPeer_mouseWheelImpl;
-		Java_sun_awt_motif_MRobotPeer_setup;
-		Java_sun_awt_motif_MScrollbarPeer_create;
-		Java_sun_awt_motif_MScrollbarPeer_setLineIncrement;
-		Java_sun_awt_motif_MScrollbarPeer_setPageIncrement;
-		Java_sun_awt_motif_MScrollbarPeer_pSetValues;
-		Java_sun_awt_motif_MScrollPanePeer_create;
-		Java_sun_awt_motif_MScrollPanePeer_pGetBlockIncrement;
-		Java_sun_awt_motif_MScrollPanePeer_pGetScrollbarSpace;
-		Java_sun_awt_motif_MScrollPanePeer_pGetShadow;
-		Java_sun_awt_motif_MScrollPanePeer_pInsets;
-		Java_sun_awt_motif_MScrollPanePeer_pSetIncrement;
-		Java_sun_awt_motif_MScrollPanePeer_pSetScrollChild;
-		Java_sun_awt_motif_MScrollPanePeer_setScrollPosition;
-		Java_sun_awt_motif_MTextAreaPeer_initIDs;
-		Java_sun_awt_motif_MTextAreaPeer_pCreate;
-		Java_sun_awt_motif_MTextAreaPeer_getCaretPosition;
-		Java_sun_awt_motif_MTextAreaPeer_getExtraHeight;
-		Java_sun_awt_motif_MTextAreaPeer_getExtraWidth;
-		Java_sun_awt_motif_MTextAreaPeer_getSelectionEnd;
-		Java_sun_awt_motif_MTextAreaPeer_getSelectionStart;
-		Java_sun_awt_motif_MTextAreaPeer_getText;
-		Java_sun_awt_motif_MTextAreaPeer_insert;
-		Java_sun_awt_motif_MTextAreaPeer_pMakeCursorVisible;
-		Java_sun_awt_motif_MTextAreaPeer_pSetEditable;
-		Java_sun_awt_motif_MTextAreaPeer_pShow2;
-		Java_sun_awt_motif_MTextAreaPeer_replaceRange;
-		Java_sun_awt_motif_MTextAreaPeer_select;
-		Java_sun_awt_motif_MTextAreaPeer_setCaretPosition;
-		Java_sun_awt_motif_MTextAreaPeer_setFont;
-		Java_sun_awt_motif_MTextAreaPeer_setText;
-		Java_sun_awt_motif_MTextAreaPeer_setTextBackground;
-		Java_sun_awt_motif_MTextFieldPeer_initIDs;
-		Java_sun_awt_motif_MTextFieldPeer_pCreate;
-		Java_sun_awt_motif_MTextFieldPeer_getCaretPosition;
-		Java_sun_awt_motif_MTextFieldPeer_getSelectionEnd;
-		Java_sun_awt_motif_MTextFieldPeer_getSelectionStart;
-		Java_sun_awt_motif_MTextFieldPeer_getText;
-		Java_sun_awt_motif_MTextFieldPeer_insertReplaceText;
-		Java_sun_awt_motif_MTextFieldPeer_preDispose;
-		Java_sun_awt_motif_MTextFieldPeer_pSetEditable;
-		Java_sun_awt_motif_MTextFieldPeer_select;
-		Java_sun_awt_motif_MTextFieldPeer_setCaretPosition;
-		Java_sun_awt_motif_MTextFieldPeer_setEchoChar;
-		Java_sun_awt_motif_MTextFieldPeer_setFont;
-		Java_sun_awt_motif_MTextFieldPeer_setText;
+		#Java_sun_awt_motif_MButtonPeer_create;
+		#Java_sun_awt_motif_MButtonPeer_setLabel;
+		#Java_sun_awt_motif_MCanvasPeer_create;
+		#Java_sun_awt_motif_MCanvasPeer_initIDs;
+		#Java_sun_awt_motif_MCanvasPeer_resetTargetGC;
+		#Java_sun_awt_motif_MCheckboxMenuItemPeer_pSetState;
+		#Java_sun_awt_motif_MCheckboxPeer_create;
+		#Java_sun_awt_motif_MCheckboxPeer_setCheckboxGroup;
+		#Java_sun_awt_motif_MCheckboxPeer_setLabel;
+		#Java_sun_awt_motif_MCheckboxPeer_pSetState;
+		#Java_sun_awt_motif_MCheckboxPeer_pGetState;
+		#Java_sun_awt_motif_MChoicePeer_addItem;
+		#Java_sun_awt_motif_MChoicePeer_appendItems;
+		#Java_sun_awt_motif_MChoicePeer_create;
+		#Java_sun_awt_motif_MChoicePeer_pReshape;
+		#Java_sun_awt_motif_MChoicePeer_remove;
+		#Java_sun_awt_motif_MChoicePeer_removeAll;
+		#Java_sun_awt_motif_MChoicePeer_setBackground;
+		#Java_sun_awt_motif_MChoicePeer_pSelect;
+		#Java_sun_awt_motif_MChoicePeer_setFont;
+		#Java_sun_awt_motif_MChoicePeer_setForeground;
+		#Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
+		#Java_sun_awt_motif_MComponentPeer_createBackBuffer;
+		#Java_sun_awt_motif_MComponentPeer_destroyBackBuffer;
+		#Java_sun_awt_motif_MComponentPeer_getNativeColor;
+		#Java_sun_awt_motif_MComponentPeer_getWindow;
+		#Java_sun_awt_motif_MComponentPeer_pDisable;
+		#Java_sun_awt_motif_MComponentPeer_pDispose;
+		#Java_sun_awt_motif_MComponentPeer_pEnable;
+		#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen;
+		#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen2;
+		#Java_sun_awt_motif_MComponentPeer_pHide;
+		#Java_sun_awt_motif_MComponentPeer_pInitialize;
+		#Java_sun_awt_motif_MComponentPeer_pMakeCursorVisible;
+		#Java_sun_awt_motif_MComponentPeer_pReshape;
+		#Java_sun_awt_motif_MComponentPeer_pShow;
+		#Java_sun_awt_motif_MComponentPeer_removeNativeDropTarget;
+		#Java_sun_awt_motif_MComponentPeer_swapBuffers;
+		#Java_sun_awt_motif_MComponentPeer_pSetBackground;
+		#Java_sun_awt_motif_MComponentPeer_pSetFont;
+                #Java_sun_awt_motif_MComponentPeer_processSynchronousLightweightTransfer;
+                #Java_sun_awt_motif_MComponentPeer__1requestFocus;
+		#Java_sun_awt_motif_MCheckboxMenuItemPeer_getState;
+		#Java_sun_awt_motif_MComponentPeer_pSetForeground;
+		#Java_sun_awt_motif_MDragSourceContextPeer_startDrag;
+		#Java_sun_awt_motif_MDragSourceContextPeer_setNativeCursor;
+		#Java_sun_awt_motif_MDropTargetContextPeer_addTransfer;
+		#Java_sun_awt_motif_MDropTargetContextPeer_dropDone;
+		#Java_sun_awt_motif_MDropTargetContextPeer_startTransfer;
+		#Java_sun_awt_motif_X11DragSourceContextPeer_startDrag;
+		#Java_sun_awt_motif_X11DragSourceContextPeer_setNativeCursor;
+		#Java_sun_awt_motif_X11DropTargetContextPeer_sendResponse;
+		#Java_sun_awt_motif_X11DropTargetContextPeer_dropDone;
+		#Java_sun_awt_motif_X11DropTargetContextPeer_getData;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_NEFcreate;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_pShowImpl;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_pReshapePrivate;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_getBoundsPrivate;
+		#Java_sun_awt_motif_MFramePeer_pSetIconImage___3B_3I_3SII;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_requestXEmbedFocus;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedApplicationActive;
+		#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedActive;
+		#Java_sun_awt_motif_MEmbeddedFrame_getWidget;
+		#Java_sun_awt_motif_MEmbeddedFrame_mapWidget;
+		#Java_sun_awt_motif_MFileDialogPeer_create;
+		#Java_sun_awt_motif_MFileDialogPeer_pDispose;
+		#Java_sun_awt_motif_MFileDialogPeer_pHide;
+		#Java_sun_awt_motif_MFileDialogPeer_pReshape;
+		#Java_sun_awt_motif_MFileDialogPeer_pShow;
+		#Java_sun_awt_motif_MFileDialogPeer_setFileEntry;
+		#Java_sun_awt_motif_MFileDialogPeer_setFont;
+		#Java_sun_awt_motif_MFramePeer_pGetIconSize;
+		#Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
+		#Java_sun_awt_motif_MGlobalCursorManager_findComponentAt;
+		#Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
+		#Java_sun_awt_motif_MGlobalCursorManager_getCursorPos;
+		#Java_sun_awt_motif_MGlobalCursorManager_getLocationOnScreen;
+		#Java_sun_awt_motif_MLabelPeer_create;
+		#Java_sun_awt_motif_MLabelPeer_setAlignment;
+		#Java_sun_awt_motif_MLabelPeer_setText;
+		#Java_sun_awt_motif_MListPeer_addItem;
+		#Java_sun_awt_motif_MListPeer_create;
+		#Java_sun_awt_motif_MListPeer_delItems;
+		#Java_sun_awt_motif_MListPeer_deselect;
+		#Java_sun_awt_motif_MListPeer_isSelected;
+		#Java_sun_awt_motif_MListPeer_makeVisible;
+		#Java_sun_awt_motif_MListPeer_select;
+		#Java_sun_awt_motif_MListPeer_setMultipleSelections;
+		#Java_sun_awt_motif_MMenuBarPeer_create;
+		#Java_sun_awt_motif_MMenuItemPeer_createMenuItem;
+		#Java_sun_awt_motif_MMenuItemPeer_pDisable;
+		#Java_sun_awt_motif_MMenuItemPeer_pDispose;
+		#Java_sun_awt_motif_MMenuItemPeer_pEnable;
+		#Java_sun_awt_motif_MMenuItemPeer_pSetLabel;
+		#Java_sun_awt_motif_MMenuPeer_createMenu;
+		#Java_sun_awt_motif_MMenuPeer_createSubMenu;
+		#Java_sun_awt_motif_MMenuPeer_pDispose;
+		#Java_sun_awt_motif_MPopupMenuPeer_createMenu;
+		#Java_sun_awt_motif_MPopupMenuPeer_pDispose;
+		#Java_sun_awt_motif_MPopupMenuPeer_pShow;
+		#Java_sun_awt_motif_MRobotPeer_getRGBPixelsImpl;
+		#Java_sun_awt_motif_MRobotPeer_keyPressImpl;
+		#Java_sun_awt_motif_MRobotPeer_keyReleaseImpl;
+		#Java_sun_awt_motif_MRobotPeer_mouseMoveImpl;
+		#Java_sun_awt_motif_MRobotPeer_mousePressImpl;
+		#Java_sun_awt_motif_MRobotPeer_mouseReleaseImpl;
+		#Java_sun_awt_motif_MRobotPeer_mouseWheelImpl;
+		#Java_sun_awt_motif_MRobotPeer_setup;
+		#Java_sun_awt_motif_MScrollbarPeer_create;
+		#Java_sun_awt_motif_MScrollbarPeer_setLineIncrement;
+		#Java_sun_awt_motif_MScrollbarPeer_setPageIncrement;
+		#Java_sun_awt_motif_MScrollbarPeer_pSetValues;
+		#Java_sun_awt_motif_MScrollPanePeer_create;
+		#Java_sun_awt_motif_MScrollPanePeer_pGetBlockIncrement;
+		#Java_sun_awt_motif_MScrollPanePeer_pGetScrollbarSpace;
+		#Java_sun_awt_motif_MScrollPanePeer_pGetShadow;
+		#Java_sun_awt_motif_MScrollPanePeer_pInsets;
+		#Java_sun_awt_motif_MScrollPanePeer_pSetIncrement;
+		#Java_sun_awt_motif_MScrollPanePeer_pSetScrollChild;
+		#Java_sun_awt_motif_MScrollPanePeer_setScrollPosition;
+		#Java_sun_awt_motif_MTextAreaPeer_initIDs;
+		#Java_sun_awt_motif_MTextAreaPeer_pCreate;
+		#Java_sun_awt_motif_MTextAreaPeer_getCaretPosition;
+		#Java_sun_awt_motif_MTextAreaPeer_getExtraHeight;
+		#Java_sun_awt_motif_MTextAreaPeer_getExtraWidth;
+		#Java_sun_awt_motif_MTextAreaPeer_getSelectionEnd;
+		#Java_sun_awt_motif_MTextAreaPeer_getSelectionStart;
+		#Java_sun_awt_motif_MTextAreaPeer_getText;
+		#Java_sun_awt_motif_MTextAreaPeer_insert;
+		#Java_sun_awt_motif_MTextAreaPeer_pMakeCursorVisible;
+		#Java_sun_awt_motif_MTextAreaPeer_pSetEditable;
+		#Java_sun_awt_motif_MTextAreaPeer_pShow2;
+		#Java_sun_awt_motif_MTextAreaPeer_replaceRange;
+		#Java_sun_awt_motif_MTextAreaPeer_select;
+		#Java_sun_awt_motif_MTextAreaPeer_setCaretPosition;
+		#Java_sun_awt_motif_MTextAreaPeer_setFont;
+		#Java_sun_awt_motif_MTextAreaPeer_setText;
+		#Java_sun_awt_motif_MTextAreaPeer_setTextBackground;
+		#Java_sun_awt_motif_MTextFieldPeer_initIDs;
+		#Java_sun_awt_motif_MTextFieldPeer_pCreate;
+		#Java_sun_awt_motif_MTextFieldPeer_getCaretPosition;
+		#Java_sun_awt_motif_MTextFieldPeer_getSelectionEnd;
+		#Java_sun_awt_motif_MTextFieldPeer_getSelectionStart;
+		#Java_sun_awt_motif_MTextFieldPeer_getText;
+		#Java_sun_awt_motif_MTextFieldPeer_insertReplaceText;
+		#Java_sun_awt_motif_MTextFieldPeer_preDispose;
+		#Java_sun_awt_motif_MTextFieldPeer_pSetEditable;
+		#Java_sun_awt_motif_MTextFieldPeer_select;
+		#Java_sun_awt_motif_MTextFieldPeer_setCaretPosition;
+		#Java_sun_awt_motif_MTextFieldPeer_setEchoChar;
+		#Java_sun_awt_motif_MTextFieldPeer_setFont;
+		#Java_sun_awt_motif_MTextFieldPeer_setText;
 		Java_sun_awt_motif_MToolkit_beep;
 		Java_sun_awt_motif_MToolkit_getLockingKeyStateNative;
 		Java_sun_awt_motif_MToolkit_getMulticlickTime;
@@ -357,28 +357,28 @@
 		Java_sun_awt_motif_MToolkit_sync;
                 Java_sun_awt_motif_MToolkit_isAlwaysOnTopSupported;
 		Java_sun_awt_motif_MWindowAttributes_initIDs;
-		Java_sun_awt_motif_MWindowPeer_pDispose;
-		Java_sun_awt_motif_MWindowPeer_pHide;
-		Java_sun_awt_motif_MWindowPeer_pReshape;
-		Java_sun_awt_motif_MWindowPeer_pSetTitle;
-		Java_sun_awt_motif_MWindowPeer_pShow;
-		Java_sun_awt_motif_MWindowPeer_setResizable;
-		Java_sun_awt_motif_MWindowPeer_toBack;
-		Java_sun_awt_motif_MWindowPeer_addTextComponentNative;
-		Java_sun_awt_motif_MWindowPeer_getState;
-		Java_sun_awt_motif_MWindowPeer_pSetIMMOption;
-		Java_sun_awt_motif_MWindowPeer_pSetMenuBar;
-		Java_sun_awt_motif_MWindowPeer_pShowModal;
-		Java_sun_awt_motif_MWindowPeer_removeTextComponentNative;
-		Java_sun_awt_motif_MWindowPeer_setSaveUnder;
-		Java_sun_awt_motif_MWindowPeer_setState;
-		Java_sun_awt_motif_MWindowPeer_resetTargetGC;
-		Java_sun_awt_motif_MWindowPeer_registerX11DropTarget;
-		Java_sun_awt_motif_MWindowPeer_unregisterX11DropTarget;
-                Java_sun_awt_motif_MWindowPeer_updateAlwaysOnTop;
-		Java_sun_awt_motif_X11CustomCursor_cacheInit;
-		Java_sun_awt_motif_X11CustomCursor_createCursor;
-		Java_sun_awt_motif_X11CustomCursor_queryBestCursor;
+		#Java_sun_awt_motif_MWindowPeer_pDispose;
+		#Java_sun_awt_motif_MWindowPeer_pHide;
+		#Java_sun_awt_motif_MWindowPeer_pReshape;
+		#Java_sun_awt_motif_MWindowPeer_pSetTitle;
+		#Java_sun_awt_motif_MWindowPeer_pShow;
+		#Java_sun_awt_motif_MWindowPeer_setResizable;
+		#Java_sun_awt_motif_MWindowPeer_toBack;
+		#Java_sun_awt_motif_MWindowPeer_addTextComponentNative;
+		#Java_sun_awt_motif_MWindowPeer_getState;
+		#Java_sun_awt_motif_MWindowPeer_pSetIMMOption;
+		#Java_sun_awt_motif_MWindowPeer_pSetMenuBar;
+		#Java_sun_awt_motif_MWindowPeer_pShowModal;
+		#Java_sun_awt_motif_MWindowPeer_removeTextComponentNative;
+		#Java_sun_awt_motif_MWindowPeer_setSaveUnder;
+		#Java_sun_awt_motif_MWindowPeer_setState;
+		#Java_sun_awt_motif_MWindowPeer_resetTargetGC;
+		#Java_sun_awt_motif_MWindowPeer_registerX11DropTarget;
+		#Java_sun_awt_motif_MWindowPeer_unregisterX11DropTarget;
+                #Java_sun_awt_motif_MWindowPeer_updateAlwaysOnTop;
+		#Java_sun_awt_motif_X11CustomCursor_cacheInit;
+		#Java_sun_awt_motif_X11CustomCursor_createCursor;
+		#Java_sun_awt_motif_X11CustomCursor_queryBestCursor;
 		Java_sun_awt_motif_X11FontMetrics_bytesWidth;
 		Java_sun_awt_motif_X11FontMetrics_getMFCharsWidth;
 		Java_sun_awt_motif_X11FontMetrics_init;
@@ -387,18 +387,18 @@
 		Java_sun_awt_X11InputMethod_resetXIC;
 		Java_sun_awt_X11InputMethod_setCompositionEnabledNative;
 		Java_sun_awt_X11InputMethod_turnoffStatusWindow;
-		Java_sun_awt_motif_MInputMethod_openXIMNative;
-		Java_sun_awt_motif_MInputMethod_configureStatusAreaNative;
-		Java_sun_awt_motif_MInputMethod_createXICNative;
-		Java_sun_awt_motif_MInputMethod_reconfigureXICNative;
-		Java_sun_awt_motif_MInputMethod_setXICFocusNative;
-		Java_sun_awt_motif_X11Clipboard_getClipboardData;
-		Java_sun_awt_motif_X11Clipboard_getClipboardFormats;
-		Java_sun_awt_motif_X11Clipboard_registerClipboardViewer;
-		Java_sun_awt_motif_X11Clipboard_unregisterClipboardViewer;
-		Java_sun_awt_motif_X11Selection_init;
-		Java_sun_awt_motif_X11Selection_pGetSelectionOwnership;
-		Java_sun_awt_motif_X11Selection_clearNativeContext;
+		#Java_sun_awt_motif_MInputMethod_openXIMNative;
+		#Java_sun_awt_motif_MInputMethod_configureStatusAreaNative;
+		#Java_sun_awt_motif_MInputMethod_createXICNative;
+		#Java_sun_awt_motif_MInputMethod_reconfigureXICNative;
+		#Java_sun_awt_motif_MInputMethod_setXICFocusNative;
+		#Java_sun_awt_motif_X11Clipboard_getClipboardData;
+		#Java_sun_awt_motif_X11Clipboard_getClipboardFormats;
+		#Java_sun_awt_motif_X11Clipboard_registerClipboardViewer;
+		#Java_sun_awt_motif_X11Clipboard_unregisterClipboardViewer;
+		#Java_sun_awt_motif_X11Selection_init;
+		#Java_sun_awt_motif_X11Selection_pGetSelectionOwnership;
+		#Java_sun_awt_motif_X11Selection_clearNativeContext;
 		Java_sun_awt_SunToolkit_closeSplashScreen;
 		Java_sun_awt_PlatformFont_initIDs;
 		Java_sun_awt_X11GraphicsConfig_init;
@@ -442,40 +442,40 @@
 		Java_java_awt_Insets_initIDs;
 		Java_java_awt_TextField_initIDs;
 		Java_java_awt_Window_initIDs;
-		Java_sun_awt_motif_MCheckboxPeer_getIndicatorSize;
-		Java_sun_awt_motif_MCheckboxPeer_getSpacing;
-		Java_sun_awt_motif_MChoicePeer_freeNativeData;
-		Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
-		Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
-		Java_sun_awt_motif_MComponentPeer_initIDs;
-		Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
-		Java_sun_awt_motif_MComponentPeer_pSetCursor;
-		Java_sun_awt_motif_MComponentPeer_pSetInnerForeground;
-		Java_sun_awt_motif_MComponentPeer_pSetScrollbarBackground;
-		Java_sun_awt_motif_MComponentPeer_setTargetBackground;
-		Java_sun_awt_motif_MDataTransferer_dragQueryFile;
-		Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
-		Java_sun_awt_motif_MDataTransferer_getTargetNameForAtom;
-		Java_sun_awt_motif_MFileDialogPeer_insertReplaceFileDialogText;
+		#Java_sun_awt_motif_MCheckboxPeer_getIndicatorSize;
+		#Java_sun_awt_motif_MCheckboxPeer_getSpacing;
+		#Java_sun_awt_motif_MChoicePeer_freeNativeData;
+		#Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
+		#Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
+		#Java_sun_awt_motif_MComponentPeer_initIDs;
+		#Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
+		#Java_sun_awt_motif_MComponentPeer_pSetCursor;
+		#Java_sun_awt_motif_MComponentPeer_pSetInnerForeground;
+		#Java_sun_awt_motif_MComponentPeer_pSetScrollbarBackground;
+		#Java_sun_awt_motif_MComponentPeer_setTargetBackground;
+		#Java_sun_awt_motif_MDataTransferer_dragQueryFile;
+		#Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
+		#Java_sun_awt_motif_MDataTransferer_getTargetNameForAtom;
+		#Java_sun_awt_motif_MFileDialogPeer_insertReplaceFileDialogText;
 		Java_sun_awt_motif_MFontPeer_initIDs;
-		Java_sun_awt_motif_MListPeer_setBackground;
-		Java_sun_awt_motif_MMenuBarPeer_initIDs;
-		Java_sun_awt_motif_MMenuBarPeer_pDispose;
-		Java_sun_awt_motif_MMenuItemPeer_getParent_1NoClientCode;
-		Java_sun_awt_motif_MMenuItemPeer_initIDs;
-		Java_sun_awt_motif_MMenuItemPeer_pSetShortcut;
-		Java_sun_awt_motif_MPopupMenuPeer_initIDs;
-		Java_sun_awt_motif_MScrollbarPeer_initIDs;
-		Java_sun_awt_motif_MScrollPanePeer_initIDs;
-		Java_sun_awt_motif_MTextAreaPeer_pSetCursor;
+		#Java_sun_awt_motif_MListPeer_setBackground;
+		#Java_sun_awt_motif_MMenuBarPeer_initIDs;
+		#Java_sun_awt_motif_MMenuBarPeer_pDispose;
+		#Java_sun_awt_motif_MMenuItemPeer_getParent_1NoClientCode;
+		#Java_sun_awt_motif_MMenuItemPeer_initIDs;
+		#Java_sun_awt_motif_MMenuItemPeer_pSetShortcut;
+		#Java_sun_awt_motif_MPopupMenuPeer_initIDs;
+		#Java_sun_awt_motif_MScrollbarPeer_initIDs;
+		#Java_sun_awt_motif_MScrollPanePeer_initIDs;
+		#Java_sun_awt_motif_MTextAreaPeer_pSetCursor;
 		Java_sun_awt_motif_MToolkit_shutdown;
-		Java_sun_awt_motif_MWindowPeer_initIDs;
-		Java_sun_awt_motif_MWindowPeer_pCreate;
-		Java_sun_awt_motif_MWindowPeer_wrapInSequenced;
+		#Java_sun_awt_motif_MWindowPeer_initIDs;
+		#Java_sun_awt_motif_MWindowPeer_pCreate;
+		#Java_sun_awt_motif_MWindowPeer_wrapInSequenced;
 		Java_sun_awt_motif_X11FontMetrics_initIDs;
-		Java_sun_awt_X11InputMethod_initIDs;
+		#Java_sun_awt_X11InputMethod_initIDs;
 		Java_sun_awt_motif_X11OffScreenImage_updateBitmask;
-		Java_sun_awt_motif_X11Selection_initIDs;
+		#Java_sun_awt_motif_X11Selection_initIDs;
 		Java_sun_awt_motif_MToolkitThreadBlockedHandler_enter;
 		Java_sun_awt_motif_MToolkitThreadBlockedHandler_exit;
 		Java_sun_awt_X11GraphicsConfig_init;
@@ -503,26 +503,26 @@
 		Java_sun_awt_X11SurfaceData_isDgaAvailable;
 		Java_sun_awt_X11SurfaceData_setInvalid;
 		Java_sun_awt_X11SurfaceData_flushNativeSurface;
-                Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer;
-                Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer;
-                Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive;
-                Java_sun_awt_motif_MEmbedCanvasPeer_initDispatching;
-                Java_sun_awt_motif_MEmbedCanvasPeer_endDispatching;
-                Java_sun_awt_motif_MEmbedCanvasPeer_embedChild;
-                Java_sun_awt_motif_MEmbedCanvasPeer_childDestroyed;
-                Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedPreferredSize;
-                Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedMinimumSize;
-                Java_sun_awt_motif_MEmbedCanvasPeer_getClientBounds;
-                Java_sun_awt_motif_MEmbedCanvasPeer_notifyChildEmbedded;
-                Java_sun_awt_motif_MEmbedCanvasPeer_detachChild;
-                Java_sun_awt_motif_MEmbedCanvasPeer_forwardKeyEvent;
-                Java_sun_awt_motif_MEmbedCanvasPeer_getAWTKeyCodeForKeySym;
-                Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__I;
-                Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__IJJJ;
-                Java_sun_awt_motif_MEmbedCanvasPeer_getWindow;       
-                Java_sun_awt_motif_MEmbedCanvasPeer_forwardEventToEmbedded;       
-                Java_sun_awt_motif_GrabbedKey_initKeySymAndModifiers;
-                Java_sun_awt_motif_MEmbeddedFramePeer_traverseOut;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_initDispatching;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_endDispatching;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_embedChild;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_childDestroyed;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedPreferredSize;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedMinimumSize;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_getClientBounds;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_notifyChildEmbedded;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_detachChild;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_forwardKeyEvent;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_getAWTKeyCodeForKeySym;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__I;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__IJJJ;
+                #Java_sun_awt_motif_MEmbedCanvasPeer_getWindow;       
+                #Java_sun_awt_motif_MEmbedCanvasPeer_forwardEventToEmbedded;       
+                #Java_sun_awt_motif_GrabbedKey_initKeySymAndModifiers;
+                #Java_sun_awt_motif_MEmbeddedFramePeer_traverseOut;
 		awt_display;
 		awt_lock;
 		awt_Lock;
--- a/jdk/make/sun/awt/mawt.gmk	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/make/sun/awt/mawt.gmk	Wed Jul 05 16:41:34 2017 +0200
@@ -28,14 +28,6 @@
 #
 INIT += $(LIB_LOCATION) 
 
-ifndef HEADLESS
-ifeq ($(PLATFORM), linux)
-ifeq ($(STATIC_MOTIF),false)
-INIT += $(LIB_LOCATION)/libXm.so
-endif
-endif
-endif
-
 #
 # Files
 #
@@ -52,13 +44,9 @@
 ifdef HEADLESS
   FILES_c = $(FILES_NO_MOTIF_c)
 else
-  FILES_c = $(FILES_MOTIF_c) $(FILES_NO_MOTIF_c)
-
-  ifeq ($(MOTIF_VERSION), 2)
-    FILES_c += awt_motif21.c
-    FILES_c += awt_Choice21.c
-  endif
-
+#  FILES_c = $(FILES_MOTIF_c) $(FILES_NO_MOTIF_c)
+#  XXX if in FILES_MOTIF_c there are unrelated to motif stuff, create a separate list!
+  FILES_c = $(FILES_NO_MOTIF_c)
 endif
 
 ifeq ($(PLATFORM), solaris)
@@ -93,15 +81,6 @@
 $(LIB_LOCATION):
 	$(MKDIR) -p $@
 
-ifeq ($(PLATFORM), linux)
-ifeq ($(STATIC_MOTIF),false)
-$(LIB_LOCATION)/libXm.so:
-	$(CP) $(MOTIF_LIB)/libXm.so $(LIB_LOCATION)/libXm.so
-# Automounter problem makes the link fail on Redhat 6.1.
-#	$(LN) -s $(MOTIF_LIB)/libXm.so $(LIB_LOCATION)/libXm.so
-endif
-endif
-
 clean:: 
 
 #
@@ -135,33 +114,49 @@
 CPPFLAGS += -DHEADLESS=$(HEADLESS)
 OTHER_LDLIBS =
 else
-CFLAGS += -DMOTIF_VERSION=$(MOTIF_VERSION)
+#CFLAGS += -DMOTIF_VERSION=$(MOTIF_VERSION)
 
-ifeq ($(STATIC_MOTIF),true)
-    LIBXM = $(MOTIF_LIB)/libXm.a -lXp -lXmu
-    ifeq ($(PLATFORM), linux)
-	ifeq ($(ARCH_DATA_MODEL), 64)
-            LIBXT = -lXt
-        else
-        # Allows for builds on Debian GNU Linux, X11 is in a different place 
-	    LIBXT = $(firstword $(wildcard /usr/X11R6/lib/libXt.a) \
-                            $(wildcard /usr/lib/libXt.a))
-	    LIBSM = $(firstword $(wildcard /usr/X11R6/lib/libSM.a) \
-                            $(wildcard /usr/lib/libSM.a))
-	    LIBICE = $(firstword $(wildcard /usr/X11R6/lib/libICE.a) \
-                             $(wildcard /usr/lib/libICE.a))
-	endif
-    endif
-else
-    LIBXM = -L$(MOTIF_LIB) -lXm -lXp
-    ifeq ($(PLATFORM), linux)
-	LIBXT = -lXt
-	LIBSM = 
-	LIBICE = 
-    endif
-endif
+#ifeq ($(STATIC_MOTIF),true)
+#    LIBXM = $(MOTIF_LIB)/libXm.a -lXp -lXmu
+#    ifeq ($(PLATFORM), linux)
+#	ifeq ($(ARCH_DATA_MODEL), 64)
+#            LIBXT = -lXt
+#        else
+#        # Allows for builds on Debian GNU Linux, X11 is in a different place 
+#	    LIBXT = $(firstword $(wildcard /usr/X11R6/lib/libXt.a) \
+#                            $(wildcard /usr/lib/libXt.a))
+#	    LIBSM = $(firstword $(wildcard /usr/X11R6/lib/libSM.a) \
+#                            $(wildcard /usr/lib/libSM.a))
+#	    LIBICE = $(firstword $(wildcard /usr/X11R6/lib/libICE.a) \
+#                             $(wildcard /usr/lib/libICE.a))
+#	endif
+#    endif
+#else
+#    LIBXM = -L$(MOTIF_LIB) -lXm -lXp
+#    ifeq ($(PLATFORM), linux)
+#	LIBXT = -lXt
+#	LIBSM = 
+#	LIBICE = 
+#    endif
+#endif
 
 LIBXTST = -lXtst
+ifeq ($(PLATFORM), linux)
+   ifeq ($(ARCH_DATA_MODEL), 64)
+   # XXX what about the rest of them?
+        LIBXT = -lXt
+    else
+    # Allows for builds on Debian GNU Linux, X11 is in a different place 
+       LIBXT = $(firstword $(wildcard /usr/X11R6/lib/libXt.a) \
+                        $(wildcard /usr/lib/libXt.a))
+       LIBSM = $(firstword $(wildcard /usr/X11R6/lib/libSM.a) \
+                        $(wildcard /usr/lib/libSM.a))
+       LIBICE = $(firstword $(wildcard /usr/X11R6/lib/libICE.a) \
+                         $(wildcard /usr/lib/libICE.a))
+       LIBXTST = $(firstword $(wildcard /usr/X11R6/lib/libXtst.a) \
+                         $(wildcard /usr/lib/libXtst.a))
+   endif
+endif
 
 # Use -lXmu for EditRes support
 LIBXMU_DBG	= -lXmu
@@ -169,14 +164,14 @@
 LIBXMU		= $(LIBXMU_$(VARIANT))
 
 ifeq ($(PLATFORM), solaris)
-OTHER_LDLIBS = $(LIBXM) -lXt -lXext $(LIBXTST) $(LIBXMU) -lX11 -lXi
+OTHER_LDLIBS = -lXt -lXext $(LIBXTST) $(LIBXMU) -lX11 -lXi
 endif
 
 ifeq ($(PLATFORM), linux)
 OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH
-OTHER_CFLAGS += -DMOTIF_VERSION=2
+# XXX what is this define below? Isn't it motif-related?
 OTHER_CFLAGS += -DXMSTRINGDEFINES=1
-OTHER_LDLIBS = $(LIBXM) $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi
+OTHER_LDLIBS =  $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi
 endif
 
 endif
@@ -199,9 +194,8 @@
 CPPFLAGS += -I$(CUPS_HEADERS_PATH)
 
 ifndef HEADLESS
-CPPFLAGS += -I$(MOTIF_DIR)/include \
-            -I$(OPENWIN_HOME)/include 
-LDFLAGS  += -L$(MOTIF_LIB) -L$(OPENWIN_LIB)
+CPPFLAGS += -I$(OPENWIN_HOME)/include 
+LDFLAGS  += -L$(OPENWIN_LIB)
 
 endif # !HEADLESS
 
--- a/jdk/src/share/bin/emessages.h	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/bin/emessages.h	Wed Jul 05 16:41:34 2017 +0200
@@ -25,8 +25,8 @@
 
 /*
  * This file primarily consists of all the error and warning messages, that
- * are used in ReportErrorMessage. All message must be defined here, in order
- * to help in I18N/L10N the messages.
+ * are used in JLI_ReportErrorMessage. All message must be defined here, in
+ * order to help with localizing the messages.
  */
 
 #ifndef _EMESSAGES_H
--- a/jdk/src/share/bin/java.c	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/bin/java.c	Wed Jul 05 16:41:34 2017 +0200
@@ -148,7 +148,7 @@
 static jboolean IsWildCardEnabled();
 
 #define ARG_CHECK(n, f, a) if (n < 1) { \
-    ReportErrorMessage(f, a); \
+    JLI_ReportErrorMessage(f, a); \
     printUsage = JNI_TRUE; \
     *pret = 1; \
     return JNI_TRUE; \
@@ -326,15 +326,15 @@
 
     start = CounterGet();
     if (!InitializeJVM(&vm, &env, &ifn)) {
-        ReportErrorMessage(JVM_ERROR1);
+        JLI_ReportErrorMessage(JVM_ERROR1);
         exit(1);
     }
 
     if (printVersion || showVersion) {
         PrintJavaVersion(env, showVersion);
         if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            ReportErrorMessage(JNI_ERROR);
+            JLI_ReportExceptionDescription(env);
+            JLI_ReportErrorMessage(JNI_ERROR);
             goto leave;
         }
         if (printVersion) {
@@ -347,8 +347,8 @@
     if (printXUsage || printUsage || (jarfile == 0 && classname == 0)) {
         PrintUsage(env, printXUsage);
         if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            ReportErrorMessage(JNI_ERROR);
+            JLI_ReportExceptionDescription(env);
+            JLI_ReportErrorMessage(JNI_ERROR);
             ret=1;
         }
         goto leave;
@@ -397,43 +397,43 @@
     if (jarfile != 0) {
         mainClassName = GetMainClassName(env, jarfile);
         if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            ReportErrorMessage(JNI_ERROR);
+            JLI_ReportExceptionDescription(env);
+            JLI_ReportErrorMessage(JNI_ERROR);
             goto leave;
         }
         if (mainClassName == NULL) {
-          ReportErrorMessage(JAR_ERROR1,jarfile, GEN_ERROR);
+          JLI_ReportErrorMessage(JAR_ERROR1,jarfile, GEN_ERROR);
           goto leave;
         }
         classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
         if (classname == NULL) {
-            ReportExceptionDescription(env);
-            ReportErrorMessage(JNI_ERROR);
+            JLI_ReportExceptionDescription(env);
+            JLI_ReportErrorMessage(JNI_ERROR);
             goto leave;
         }
         mainClass = LoadClass(env, classname);
         if(mainClass == NULL) { /* exception occured */
-            ReportExceptionDescription(env);
-            ReportErrorMessage(CLS_ERROR1, classname);
+            JLI_ReportExceptionDescription(env);
+            JLI_ReportErrorMessage(CLS_ERROR1, classname);
             goto leave;
         }
         (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
     } else {
       mainClassName = NewPlatformString(env, classname);
       if (mainClassName == NULL) {
-        ReportErrorMessage(CLS_ERROR2, classname, GEN_ERROR);
+        JLI_ReportErrorMessage(CLS_ERROR2, classname, GEN_ERROR);
         goto leave;
       }
       classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
       if (classname == NULL) {
-        ReportExceptionDescription(env);
-        ReportErrorMessage(JNI_ERROR);
+        JLI_ReportExceptionDescription(env);
+        JLI_ReportErrorMessage(JNI_ERROR);
         goto leave;
       }
       mainClass = LoadClass(env, classname);
       if(mainClass == NULL) { /* exception occured */
-        ReportExceptionDescription(env);
-        ReportErrorMessage(CLS_ERROR1, classname);
+        JLI_ReportExceptionDescription(env);
+        JLI_ReportErrorMessage(CLS_ERROR1, classname);
         goto leave;
       }
       (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
@@ -444,10 +444,10 @@
                                        "([Ljava/lang/String;)V");
     if (mainID == NULL) {
         if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            ReportErrorMessage(JNI_ERROR);
+            JLI_ReportExceptionDescription(env);
+            JLI_ReportErrorMessage(JNI_ERROR);
         } else {
-          ReportErrorMessage(CLS_ERROR3);
+          JLI_ReportErrorMessage(CLS_ERROR3);
         }
         goto leave;
     }
@@ -459,8 +459,8 @@
                                                 mainID, JNI_TRUE);
 
         if( obj == NULL) { /* exception occurred */
-            ReportExceptionDescription(env);
-            ReportErrorMessage(JNI_ERROR);
+            JLI_ReportExceptionDescription(env);
+            JLI_ReportErrorMessage(JNI_ERROR);
             goto leave;
         }
 
@@ -469,14 +469,14 @@
                               (*env)->GetObjectClass(env, obj),
                               "getModifiers", "()I");
         if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            ReportErrorMessage(JNI_ERROR);
+            JLI_ReportExceptionDescription(env);
+            JLI_ReportErrorMessage(JNI_ERROR);
             goto leave;
         }
 
         mods = (*env)->CallIntMethod(env, obj, mid);
         if ((mods & 1) == 0) { /* if (!Modifier.isPublic(mods)) ... */
-            ReportErrorMessage(CLS_ERROR4);
+            JLI_ReportErrorMessage(CLS_ERROR4);
             goto leave;
         }
     }
@@ -484,8 +484,8 @@
     /* Build argument array */
     mainArgs = NewPlatformStringArray(env, argv, argc);
     if (mainArgs == NULL) {
-        ReportExceptionDescription(env);
-        ReportErrorMessage(JNI_ERROR);
+        JLI_ReportExceptionDescription(env);
+        JLI_ReportErrorMessage(JNI_ERROR);
         goto leave;
     }
 
@@ -506,7 +506,7 @@
      * launcher's return code except by calling System.exit.
      */
     if ((*vm)->DetachCurrentThread(vm) != 0) {
-        ReportErrorMessage(JVM_ERROR2);
+        JLI_ReportErrorMessage(JVM_ERROR2);
         ret = 1;
         goto leave;
     }
@@ -635,7 +635,7 @@
 
         if (loopCount > knownVMsCount) {
           if (!speculative) {
-            ReportErrorMessage(CFG_ERROR1);
+            JLI_ReportErrorMessage(CFG_ERROR1);
             exit(1);
           } else {
             return "ERROR";
@@ -645,7 +645,7 @@
 
         if (nextIdx < 0) {
           if (!speculative) {
-            ReportErrorMessage(CFG_ERROR2, knownVMs[jvmidx].alias);
+            JLI_ReportErrorMessage(CFG_ERROR2, knownVMs[jvmidx].alias);
             exit(1);
           } else {
             return "ERROR";
@@ -660,7 +660,7 @@
     switch (knownVMs[jvmidx].flag) {
     case VM_WARN:
         if (!speculative) {
-            ReportErrorMessage(CFG_WARN1, jvmtype, knownVMs[0].name + 1);
+            JLI_ReportErrorMessage(CFG_WARN1, jvmtype, knownVMs[0].name + 1);
         }
         /* fall through */
     case VM_IGNORE:
@@ -670,7 +670,7 @@
         break;
     case VM_ERROR:
         if (!speculative) {
-            ReportErrorMessage(CFG_ERROR3, jvmtype);
+            JLI_ReportErrorMessage(CFG_ERROR3, jvmtype);
             exit(1);
         } else {
             return "ERROR";
@@ -879,9 +879,9 @@
     if (jarflag && operand) {
         if ((res = JLI_ParseManifest(operand, &info)) != 0) {
             if (res == -1)
-                ReportErrorMessage(JAR_ERROR2, operand);
+                JLI_ReportErrorMessage(JAR_ERROR2, operand);
             else
-                ReportErrorMessage(JAR_ERROR3, operand);
+                JLI_ReportErrorMessage(JAR_ERROR3, operand);
             exit(1);
         }
 
@@ -948,7 +948,7 @@
      * Check for correct syntax of the version specification (JSR 56).
      */
     if (!JLI_ValidVersionString(info.jre_version)) {
-        ReportErrorMessage(SPC_ERROR1, info.jre_version);
+        JLI_ReportErrorMessage(SPC_ERROR1, info.jre_version);
         exit(1);
     }
 
@@ -970,7 +970,7 @@
             JLI_MemFree(new_argv);
             return;
         } else {
-            ReportErrorMessage(CFG_ERROR4, info.jre_version);
+            JLI_ReportErrorMessage(CFG_ERROR4, info.jre_version);
             exit(1);
         }
     }
@@ -1040,7 +1040,7 @@
  * command line options.
  */
         } else if (JLI_StrCmp(arg, "-fullversion") == 0) {
-            ReportMessage("%s full version \"%s\"", _launcher_name, GetFullVersion());
+            JLI_ReportMessage("%s full version \"%s\"", _launcher_name, GetFullVersion());
             return JNI_FALSE;
         } else if (JLI_StrCmp(arg, "-verbosegc") == 0) {
             AddOption("-verbose:gc", NULL);
@@ -1080,7 +1080,7 @@
                    JLI_StrCmp(arg, "-cs") == 0 ||
                    JLI_StrCmp(arg, "-noasyncgc") == 0) {
             /* No longer supported */
-            ReportErrorMessage(ARG_WARN, arg);
+            JLI_ReportErrorMessage(ARG_WARN, arg);
         } else if (JLI_StrCCmp(arg, "-version:") == 0 ||
                    JLI_StrCmp(arg, "-no-jre-restrict-search") == 0 ||
                    JLI_StrCmp(arg, "-jre-restrict-search") == 0 ||
@@ -1143,12 +1143,12 @@
 
 
 #define NULL_CHECK0(e) if ((e) == 0) { \
-    ReportErrorMessage(JNI_ERROR); \
+    JLI_ReportErrorMessage(JNI_ERROR); \
     return 0; \
   }
 
 #define NULL_CHECK(e) if ((e) == 0) { \
-    ReportErrorMessage(JNI_ERROR); \
+    JLI_ReportErrorMessage(JNI_ERROR); \
     return; \
   }
 
@@ -1351,7 +1351,7 @@
         char *arg = argv[i];
         if (arg[0] == '-' && arg[1] == 'J') {
             if (arg[2] == '\0') {
-                ReportErrorMessage(ARG_ERROR3);
+                JLI_ReportErrorMessage(ARG_ERROR3);
                 exit(1);
             }
             *nargv++ = arg + 2;
@@ -1418,7 +1418,7 @@
     }
 
     if (!GetApplicationHome(home, sizeof(home))) {
-        ReportErrorMessage(CFG_ERROR5);
+        JLI_ReportErrorMessage(CFG_ERROR5);
         return JNI_FALSE;
     }
 
@@ -1691,7 +1691,7 @@
     jvmCfg = fopen(jvmCfgName, "r");
     if (jvmCfg == NULL) {
       if (!speculative) {
-        ReportErrorMessage(CFG_ERROR6, jvmCfgName);
+        JLI_ReportErrorMessage(CFG_ERROR6, jvmCfgName);
         exit(1);
       } else {
         return -1;
@@ -1703,7 +1703,7 @@
         if (line[0] == '#')
             continue;
         if (line[0] != '-') {
-            ReportErrorMessage(CFG_WARN2, lineno, jvmCfgName);
+            JLI_ReportErrorMessage(CFG_WARN2, lineno, jvmCfgName);
         }
         if (cnt >= knownVMsLimit) {
             GrowKnownVMs(cnt);
@@ -1711,13 +1711,13 @@
         line[JLI_StrLen(line)-1] = '\0'; /* remove trailing newline */
         tmpPtr = line + JLI_StrCSpn(line, whiteSpace);
         if (*tmpPtr == 0) {
-            ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
+            JLI_ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
         } else {
             /* Null-terminate this string for JLI_StringDup below */
             *tmpPtr++ = 0;
             tmpPtr += JLI_StrSpn(tmpPtr, whiteSpace);
             if (*tmpPtr == 0) {
-                ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
+                JLI_ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
             } else {
                 if (!JLI_StrCCmp(tmpPtr, "KNOWN")) {
                     vmType = VM_KNOWN;
@@ -1727,7 +1727,7 @@
                         tmpPtr += JLI_StrSpn(tmpPtr, whiteSpace);
                     }
                     if (*tmpPtr == 0) {
-                        ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
+                        JLI_ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
                     } else {
                         /* Null terminate altVMName */
                         altVMName = tmpPtr;
@@ -1747,7 +1747,7 @@
                         tmpPtr += JLI_StrSpn(tmpPtr, whiteSpace);
                     }
                     if (*tmpPtr == 0) {
-                        ReportErrorMessage(CFG_WARN4, lineno, jvmCfgName);
+                        JLI_ReportErrorMessage(CFG_WARN4, lineno, jvmCfgName);
                     } else {
                         /* Null terminate server class VM name */
                         serverClassVMName = tmpPtr;
@@ -1756,7 +1756,7 @@
                         vmType = VM_IF_SERVER_CLASS;
                     }
                 } else {
-                    ReportErrorMessage(CFG_WARN5, lineno, &jvmCfgName[0]);
+                    JLI_ReportErrorMessage(CFG_WARN5, lineno, &jvmCfgName[0]);
                     vmType = VM_KNOWN;
                 }
             }
@@ -2019,7 +2019,7 @@
  * A utility procedure to always print to stderr
  */
 void
-ReportMessage(const char* fmt, ...)
+JLI_ReportMessage(const char* fmt, ...)
 {
     va_list vl;
     va_start(vl, fmt);
--- a/jdk/src/share/bin/java.h	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/bin/java.h	Wed Jul 05 16:41:34 2017 +0200
@@ -121,24 +121,20 @@
                                        char jvmpath[],
                                        jint so_jvmpath,
                                        char **original_argv);
+/* Reports an error message to stderr or a window as appropriate. */
+void JLI_ReportErrorMessage(const char * message, ...);
+
+/* Reports a system error message to stderr or a window */
+void JLI_ReportErrorMessageSys(const char * message, ...);
+
+/* Reports an error message only to stderr. */
+void JLI_ReportMessage(const char * message, ...);
 
 /*
- * Report an error message to stderr or a window as appropriate.
- */
-void ReportErrorMessage(const char * message, ...);
-void ReportErrorMessageSys(const char * format, ...);
-
-/*
- * Report an error message only to stderr.
- */
-void ReportMessage(const char * message, ...);
-
-/*
- * Report an exception which terminates the vm to stderr or a window
+ * Reports an exception which terminates the vm to stderr or a window
  * as appropriate.
  */
-void ReportExceptionDescription(JNIEnv * env);
-
+void JLI_ReportExceptionDescription(JNIEnv * env);
 void PrintMachineDependentOptions();
 
 const char *jlong_format_specifier();
--- a/jdk/src/share/classes/com/sun/jmx/defaults/JmxProperties.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/defaults/JmxProperties.java	Wed Jul 05 16:41:34 2017 +0200
@@ -177,6 +177,18 @@
             "javax.management.relation";
 
     /**
+     * Logger name for Namespaces.
+     */
+    public static final String NAMESPACE_LOGGER_NAME =
+            "javax.management.namespace";
+
+     /**
+     * Logger name for Namespaces.
+     */
+    public static final Logger NAMESPACE_LOGGER =
+            Logger.getLogger(NAMESPACE_LOGGER_NAME);
+
+    /**
      * Logger for Relation Service.
      */
     public static final Logger RELATION_LOGGER =
--- a/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java	Wed Jul 05 16:41:34 2017 +0200
@@ -25,33 +25,49 @@
 
 package com.sun.jmx.interceptor;
 
-// java import
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.WeakHashMap;
+
+// JMX RI
+import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER;
+import com.sun.jmx.mbeanserver.DynamicMBean2;
+import com.sun.jmx.mbeanserver.Introspector;
+import com.sun.jmx.mbeanserver.MBeanInjector;
+import com.sun.jmx.mbeanserver.MBeanInstantiator;
+import com.sun.jmx.mbeanserver.ModifiableClassLoaderRepository;
+import com.sun.jmx.mbeanserver.NamedObject;
+import com.sun.jmx.mbeanserver.NotifySupport;
+import com.sun.jmx.mbeanserver.Repository;
+import com.sun.jmx.mbeanserver.Repository.RegistrationContext;
+import com.sun.jmx.mbeanserver.Util;
+import com.sun.jmx.remote.util.EnvHelp;
+
 import java.lang.ref.WeakReference;
 import java.security.AccessControlContext;
+import java.security.AccessController;
 import java.security.Permission;
+import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Queue;
+import java.util.Set;
+import java.util.WeakHashMap;
+import java.util.logging.Level;
 
 // JMX import
 import javax.management.Attribute;
 import javax.management.AttributeList;
 import javax.management.AttributeNotFoundException;
 import javax.management.DynamicMBean;
+import javax.management.DynamicWrapperMBean;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.IntrospectionException;
 import javax.management.InvalidAttributeValueException;
 import javax.management.JMRuntimeException;
 import javax.management.ListenerNotFoundException;
-import javax.management.MalformedObjectNameException;
 import javax.management.MBeanException;
 import javax.management.MBeanInfo;
 import javax.management.MBeanPermission;
@@ -64,6 +80,7 @@
 import javax.management.NotCompliantMBeanException;
 import javax.management.Notification;
 import javax.management.NotificationBroadcaster;
+import javax.management.NotificationBroadcasterSupport;
 import javax.management.NotificationEmitter;
 import javax.management.NotificationFilter;
 import javax.management.NotificationListener;
@@ -75,22 +92,7 @@
 import javax.management.RuntimeErrorException;
 import javax.management.RuntimeMBeanException;
 import javax.management.RuntimeOperationsException;
-
-// JMX RI
-import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER;
-import com.sun.jmx.mbeanserver.DynamicMBean2;
-import com.sun.jmx.mbeanserver.ModifiableClassLoaderRepository;
-import com.sun.jmx.mbeanserver.MBeanInstantiator;
-import com.sun.jmx.mbeanserver.Repository;
-import com.sun.jmx.mbeanserver.NamedObject;
-import com.sun.jmx.mbeanserver.Introspector;
-import com.sun.jmx.mbeanserver.MBeanInjector;
-import com.sun.jmx.mbeanserver.NotifySupport;
-import com.sun.jmx.mbeanserver.Repository.RegistrationContext;
-import com.sun.jmx.mbeanserver.Util;
-import com.sun.jmx.remote.util.EnvHelp;
-import javax.management.DynamicWrapperMBean;
-import javax.management.NotificationBroadcasterSupport;
+import javax.management.namespace.JMXNamespace;
 
 /**
  * This is the default class for MBean manipulation on the agent side. It
@@ -113,7 +115,8 @@
  *
  * @since 1.5
  */
-public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
+public class DefaultMBeanServerInterceptor
+        extends MBeanServerInterceptorSupport {
 
     /** The MBeanInstantiator object used by the
      *  DefaultMBeanServerInterceptor */
@@ -123,7 +126,7 @@
      *  DefaultMBeanServerInterceptor */
     private transient MBeanServer server = null;
 
-    /** The MBean server object taht associated to the
+    /** The MBean server delegate object that is associated to the
      *  DefaultMBeanServerInterceptor */
     private final transient MBeanServerDelegate delegate;
 
@@ -138,13 +141,15 @@
                 new WeakHashMap<ListenerWrapper,
                                 WeakReference<ListenerWrapper>>();
 
+    private final NamespaceDispatchInterceptor dispatcher;
+
     /** The default domain of the object names */
     private final String domain;
 
-    /** True if the repository perform queries, false otherwise */
-    private boolean queryByRepo;
+    /** The mbeanServerName  */
+    private final String mbeanServerName;
 
-    /** The sequence number identifyng the notifications sent */
+    /** The sequence number identifying the notifications sent */
     // Now sequence number is handled by MBeanServerDelegate.
     // private int sequenceNumber=0;
 
@@ -162,11 +167,13 @@
      * @param instantiator The MBeanInstantiator that will be used to
      *        instantiate MBeans and take care of class loading issues.
      * @param repository The repository to use for this MBeanServer.
+     * @param dispatcher The dispatcher used by this MBeanServer
      */
     public DefaultMBeanServerInterceptor(MBeanServer         outer,
                                          MBeanServerDelegate delegate,
                                          MBeanInstantiator   instantiator,
-                                         Repository          repository)  {
+                                         Repository          repository,
+                                         NamespaceDispatchInterceptor dispatcher)  {
         if (outer == null) throw new
             IllegalArgumentException("outer MBeanServer cannot be null");
         if (delegate == null) throw new
@@ -181,6 +188,8 @@
         this.instantiator = instantiator;
         this.repository   = repository;
         this.domain       = repository.getDefaultDomain();
+        this.dispatcher   = dispatcher;
+        this.mbeanServerName = Util.getMBeanServerSecurityName(delegate);
     }
 
     public ObjectInstance createMBean(String className, ObjectName name)
@@ -259,8 +268,8 @@
             name = nonDefaultDomain(name);
         }
 
-        checkMBeanPermission(className, null, null, "instantiate");
-        checkMBeanPermission(className, null, name, "registerMBean");
+        checkMBeanPermission(mbeanServerName,className, null, null, "instantiate");
+        checkMBeanPermission(mbeanServerName,className, null, name, "registerMBean");
 
         /* Load the appropriate class. */
         if (withDefaultLoaderRepository) {
@@ -324,7 +333,7 @@
 
         final String infoClassName = getNewMBeanClassName(object);
 
-        checkMBeanPermission(infoClassName, null, name, "registerMBean");
+        checkMBeanPermission(mbeanServerName,infoClassName, null, name, "registerMBean");
         checkMBeanTrustPermission(theClass);
 
         return registerObject(infoClassName, object, name);
@@ -433,7 +442,8 @@
         DynamicMBean instance = getMBean(name);
         // may throw InstanceNotFoundException
 
-        checkMBeanPermission(instance, null, name, "unregisterMBean");
+        checkMBeanPermission(mbeanServerName, instance, null, name,
+                "unregisterMBean");
 
         if (instance instanceof MBeanRegistration)
             preDeregisterInvoke((MBeanRegistration) instance);
@@ -467,7 +477,8 @@
         name = nonDefaultDomain(name);
         DynamicMBean instance = getMBean(name);
 
-        checkMBeanPermission(instance, null, name, "getObjectInstance");
+        checkMBeanPermission(mbeanServerName,
+                instance, null, name, "getObjectInstance");
 
         final String className = getClassName(instance);
 
@@ -479,7 +490,7 @@
         if (sm != null) {
             // Check if the caller has the right to invoke 'queryMBeans'
             //
-            checkMBeanPermission((String) null, null, null, "queryMBeans");
+            checkMBeanPermission(mbeanServerName,(String) null, null, null, "queryMBeans");
 
             // Perform query without "query".
             //
@@ -492,7 +503,7 @@
                 new HashSet<ObjectInstance>(list.size());
             for (ObjectInstance oi : list) {
                 try {
-                    checkMBeanPermission(oi.getClassName(), null,
+                    checkMBeanPermission(mbeanServerName,oi.getClassName(), null,
                                          oi.getObjectName(), "queryMBeans");
                     allowedList.add(oi);
                 } catch (SecurityException e) {
@@ -516,11 +527,6 @@
         //
         Set<NamedObject> list = repository.query(name, query);
 
-        if (queryByRepo) {
-            // The repository performs the filtering
-            query = null;
-        }
-
         return (objectInstancesFromFilteredNamedObjects(list, query));
     }
 
@@ -530,7 +536,7 @@
         if (sm != null) {
             // Check if the caller has the right to invoke 'queryNames'
             //
-            checkMBeanPermission((String) null, null, null, "queryNames");
+            checkMBeanPermission(mbeanServerName,(String) null, null, null, "queryNames");
 
             // Perform query without "query".
             //
@@ -543,7 +549,7 @@
                 new HashSet<ObjectInstance>(list.size());
             for (ObjectInstance oi : list) {
                 try {
-                    checkMBeanPermission(oi.getClassName(), null,
+                    checkMBeanPermission(mbeanServerName, oi.getClassName(), null,
                                          oi.getObjectName(), "queryNames");
                     allowedList.add(oi);
                 } catch (SecurityException e) {
@@ -572,11 +578,6 @@
         //
         Set<NamedObject> list = repository.query(name, query);
 
-        if (queryByRepo) {
-            // The repository performs the filtering
-            query = null;
-        }
-
         return (objectNamesFromFilteredNamedObjects(list, query));
     }
 
@@ -589,8 +590,8 @@
 
         name = nonDefaultDomain(name);
 
-//      /* Permission check */
-//      checkMBeanPermission(null, null, name, "isRegistered");
+        /* No Permission check */
+        // isRegistered is always unchecked as per JMX spec.
 
         return (repository.contains(name));
     }
@@ -600,7 +601,7 @@
         if (sm != null) {
             // Check if the caller has the right to invoke 'getDomains'
             //
-            checkMBeanPermission((String) null, null, null, "getDomains");
+            checkMBeanPermission(mbeanServerName, (String) null, null, null, "getDomains");
 
             // Return domains
             //
@@ -612,8 +613,9 @@
             List<String> result = new ArrayList<String>(domains.length);
             for (int i = 0; i < domains.length; i++) {
                 try {
-                    ObjectName domain = Util.newObjectName(domains[i] + ":x=x");
-                    checkMBeanPermission((String) null, null, domain, "getDomains");
+                    ObjectName dom =
+                            Util.newObjectName(domains[i] + ":x=x");
+                    checkMBeanPermission(mbeanServerName, (String) null, null, dom, "getDomains");
                     result.add(domains[i]);
                 } catch (SecurityException e) {
                     // OK: Do not add this domain to the list
@@ -657,7 +659,8 @@
         }
 
         final DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(instance, attribute, name, "getAttribute");
+        checkMBeanPermission(mbeanServerName, instance, attribute,
+                name, "getAttribute");
 
         try {
             return instance.getAttribute(attribute);
@@ -702,7 +705,7 @@
 
             // Check if the caller has the right to invoke 'getAttribute'
             //
-            checkMBeanPermission(classname, null, name, "getAttribute");
+            checkMBeanPermission(mbeanServerName, classname, null, name, "getAttribute");
 
             // Check if the caller has the right to invoke 'getAttribute'
             // on each specific attribute
@@ -711,14 +714,15 @@
                 new ArrayList<String>(attributes.length);
             for (String attr : attributes) {
                 try {
-                    checkMBeanPermission(classname, attr,
+                    checkMBeanPermission(mbeanServerName, classname, attr,
                                          name, "getAttribute");
                     allowedList.add(attr);
                 } catch (SecurityException e) {
                     // OK: Do not add this attribute to the list
                 }
             }
-            allowedAttributes = allowedList.toArray(new String[0]);
+            allowedAttributes =
+                    allowedList.toArray(new String[allowedList.size()]);
         }
 
         try {
@@ -756,7 +760,7 @@
         }
 
         DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(instance, attribute.getName(),
+        checkMBeanPermission(mbeanServerName, instance, attribute.getName(),
                              name, "setAttribute");
 
         try {
@@ -799,7 +803,7 @@
 
             // Check if the caller has the right to invoke 'setAttribute'
             //
-            checkMBeanPermission(classname, null, name, "setAttribute");
+            checkMBeanPermission(mbeanServerName, classname, null, name, "setAttribute");
 
             // Check if the caller has the right to invoke 'setAttribute'
             // on each specific attribute
@@ -808,7 +812,7 @@
             for (Iterator i = attributes.iterator(); i.hasNext();) {
                 try {
                     Attribute attribute = (Attribute) i.next();
-                    checkMBeanPermission(classname, attribute.getName(),
+                    checkMBeanPermission(mbeanServerName, classname, attribute.getName(),
                                          name, "setAttribute");
                     allowedAttributes.add(attribute);
                 } catch (SecurityException e) {
@@ -832,7 +836,8 @@
         name = nonDefaultDomain(name);
 
         DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(instance, operationName, name, "invoke");
+        checkMBeanPermission(mbeanServerName, instance, operationName,
+                name, "invoke");
         try {
             return instance.invoke(operationName, params, signature);
         } catch (Throwable t) {
@@ -934,8 +939,7 @@
                     "registerMBean", "ObjectName = " + name);
         }
 
-        ObjectName logicalName = name;
-        logicalName = preRegister(mbean, server, name);
+        ObjectName logicalName = preRegister(mbean, server, name);
 
         // preRegister returned successfully, so from this point on we
         // must call postRegister(false) if there is any problem.
@@ -961,16 +965,17 @@
 
             if (logicalName != name && logicalName != null) {
                 logicalName =
-                    ObjectName.getInstance(nonDefaultDomain(logicalName));
+                        ObjectName.getInstance(nonDefaultDomain(logicalName));
             }
 
-            checkMBeanPermission(classname, null, logicalName, "registerMBean");
+            checkMBeanPermission(mbeanServerName, classname, null, logicalName,
+                    "registerMBean");
 
             if (logicalName == null) {
                 final RuntimeException wrapped =
-                        new IllegalArgumentException("No object name specified");
+                    new IllegalArgumentException("No object name specified");
                 throw new RuntimeOperationsException(wrapped,
-                                                     "Exception occurred trying to register the MBean");
+                            "Exception occurred trying to register the MBean");
             }
 
             final Object resource = getResource(mbean);
@@ -987,13 +992,15 @@
             //
             context = registerWithRepository(resource, mbean, logicalName);
 
+
             registerFailed = false;
             registered = true;
+
         } finally {
             try {
                 postRegister(logicalName, mbean, registered, registerFailed);
             } finally {
-                if (registered) context.done();
+                if (registered && context!=null) context.done();
             }
         }
         return new ObjectInstance(logicalName, classname);
@@ -1001,20 +1008,19 @@
 
     private static void throwMBeanRegistrationException(Throwable t, String where)
     throws MBeanRegistrationException {
-        try {
-            throw t;
-        } catch (RuntimeException e) {
-                throw new RuntimeMBeanException(
-                        e, "RuntimeException thrown " + where);
-        } catch (Error er) {
-                throw new RuntimeErrorException(er, "Error thrown " + where);
-        } catch (MBeanRegistrationException r) {
-            throw r;
-        } catch (Exception ex) {
-            throw new MBeanRegistrationException(ex, "Exception thrown " + where);
-        } catch (Throwable t1) {
-            throw new RuntimeException(t);  // neither Error nor Exception??
-        }
+        if (t instanceof RuntimeException) {
+            throw new RuntimeMBeanException((RuntimeException)t,
+                    "RuntimeException thrown " + where);
+        } else if (t instanceof Error) {
+            throw new RuntimeErrorException((Error)t,
+                    "Error thrown " + where);
+        } else if (t instanceof MBeanRegistrationException) {
+            throw (MBeanRegistrationException)t;
+        } else if (t instanceof Exception) {
+            throw new MBeanRegistrationException((Exception)t,
+                    "Exception thrown " + where);
+        } else // neither Error nor Exception??
+            throw new RuntimeException(t);
     }
 
     private static ObjectName preRegister(
@@ -1230,7 +1236,8 @@
         }
 
         DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(instance, null, name, "addNotificationListener");
+        checkMBeanPermission(mbeanServerName, instance, null,
+                name, "addNotificationListener");
 
         NotificationBroadcaster broadcaster =
                 getNotificationBroadcaster(name, instance,
@@ -1367,7 +1374,7 @@
         }
 
         DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(instance, null, name,
+        checkMBeanPermission(mbeanServerName, instance, null, name,
                              "removeNotificationListener");
 
         /* We could simplify the code by assigning broadcaster after
@@ -1438,7 +1445,7 @@
             throw new JMRuntimeException("MBean " + name +
                                          "has no MBeanInfo");
 
-        checkMBeanPermission(mbi.getClassName(), null, name, "getMBeanInfo");
+        checkMBeanPermission(mbeanServerName, mbi.getClassName(), null, name, "getMBeanInfo");
 
         return mbi;
     }
@@ -1446,8 +1453,9 @@
     public boolean isInstanceOf(ObjectName name, String className)
         throws InstanceNotFoundException {
 
-        DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(instance, null, name, "isInstanceOf");
+        final DynamicMBean instance = getMBean(name);
+        checkMBeanPermission(mbeanServerName,
+                instance, null, name, "isInstanceOf");
 
         try {
             Object resource = getResource(instance);
@@ -1498,7 +1506,8 @@
         throws InstanceNotFoundException {
 
         DynamicMBean instance = getMBean(mbeanName);
-        checkMBeanPermission(instance, null, mbeanName, "getClassLoaderFor");
+        checkMBeanPermission(mbeanServerName, instance, null, mbeanName,
+                "getClassLoaderFor");
         return getResourceLoader(instance);
     }
 
@@ -1513,12 +1522,13 @@
             throws InstanceNotFoundException {
 
         if (loaderName == null) {
-            checkMBeanPermission((String) null, null, null, "getClassLoader");
+            checkMBeanPermission(mbeanServerName, (String) null, null, null, "getClassLoader");
             return server.getClass().getClassLoader();
         }
 
         DynamicMBean instance = getMBean(loaderName);
-        checkMBeanPermission(instance, null, loaderName, "getClassLoader");
+        checkMBeanPermission(mbeanServerName, instance, null, loaderName,
+                "getClassLoader");
 
         Object resource = getResource(instance);
 
@@ -1568,7 +1578,7 @@
             }
         } else {
             // Access the filter
-            MBeanServer oldServer = QueryEval.getMBeanServer();
+            final MBeanServer oldServer = QueryEval.getMBeanServer();
             query.setMBeanServer(server);
             try {
                 for (NamedObject no : list) {
@@ -1817,26 +1827,30 @@
             return mbean.getMBeanInfo().getClassName();
     }
 
-    private static void checkMBeanPermission(DynamicMBean mbean,
+    private static void checkMBeanPermission(String mbeanServerName,
+                                             DynamicMBean mbean,
                                              String member,
                                              ObjectName objectName,
                                              String actions) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            checkMBeanPermission(safeGetClassName(mbean),
+            checkMBeanPermission(mbeanServerName,
+                                 safeGetClassName(mbean),
                                  member,
                                  objectName,
                                  actions);
         }
     }
 
-    private static void checkMBeanPermission(String classname,
+    private static void checkMBeanPermission(String mbeanServerName,
+                                             String classname,
                                              String member,
                                              ObjectName objectName,
                                              String actions) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            Permission perm = new MBeanPermission(classname,
+            Permission perm = new MBeanPermission(mbeanServerName,
+                                                  classname,
                                                   member,
                                                   objectName,
                                                   actions);
@@ -1902,6 +1916,12 @@
             throws InstanceAlreadyExistsException,
             MBeanRegistrationException {
 
+        // this will throw an exception if the pair (resource, logicalName)
+        // violates namespace conventions - for instance, if logicalName
+        // ends with // but resource is not a JMXNamespace.
+        //
+        checkResourceObjectNameConstraints(resource, logicalName);
+
         // Creates a registration context, if needed.
         //
         final ResourceContext context =
@@ -1967,6 +1987,57 @@
         return context;
     }
 
+
+    /**
+     * Checks that the ObjectName is legal with regards to the
+     * type of the MBean resource.
+     * If the MBean name is  domain:type=JMXDomain, the
+     *     MBean must be a JMXDomain.
+     * If the MBean name is  namespace//:type=JMXNamespace, the
+     *     MBean must be a JMXNamespace.
+     * If the MBean is a JMXDomain, its name
+     *      must be domain:type=JMXDomain.
+     * If the MBean is a JMXNamespace,  its name
+     *      must be namespace//:type=JMXNamespace.
+     */
+    private void checkResourceObjectNameConstraints(Object resource,
+            ObjectName logicalName)
+            throws MBeanRegistrationException {
+        try {
+            dispatcher.checkLocallyRegistrable(resource, logicalName);
+        } catch (Throwable x) {
+            DefaultMBeanServerInterceptor.throwMBeanRegistrationException(x, "validating ObjectName");
+        }
+    }
+
+    /**
+     * Registers a JMXNamespace with the dispatcher.
+     * This method is called by the ResourceContext from within the
+     * repository lock.
+     * @param namespace    The JMXNamespace
+     * @param logicalName  The JMXNamespaceMBean ObjectName
+     * @param postQueue    A queue that will be processed after postRegister.
+     */
+    private void addJMXNamespace(JMXNamespace namespace,
+            final ObjectName logicalName,
+            final Queue<Runnable> postQueue) {
+        dispatcher.addNamespace(logicalName, namespace, postQueue);
+    }
+
+    /**
+     * Unregisters a JMXNamespace from the dispatcher.
+     * This method is called by the ResourceContext from within the
+     * repository lock.
+     * @param namespace    The JMXNamespace
+     * @param logicalName  The JMXNamespaceMBean ObjectName
+     * @param postQueue    A queue that will be processed after postDeregister.
+     */
+    private void removeJMXNamespace(JMXNamespace namespace,
+            final ObjectName logicalName,
+            final Queue<Runnable> postQueue) {
+        dispatcher.removeNamespace(logicalName, namespace, postQueue);
+    }
+
     /**
      * Registers a ClassLoader with the CLR.
      * This method is called by the ResourceContext from within the
@@ -2020,6 +2091,52 @@
         }
     }
 
+
+    /**
+     * Creates a ResourceContext for a JMXNamespace MBean.
+     * The resource context makes it possible to add the JMXNamespace to
+     * (ResourceContext.registering) or resp. remove the JMXNamespace from
+     * (ResourceContext.unregistered) the NamespaceDispatchInterceptor
+     * when the associated MBean is added to or resp. removed from the
+     * repository.
+     * Note: JMXDomains are special sub classes of JMXNamespaces and
+     *       are also handled by this object.
+     *
+     * @param namespace    The JMXNamespace MBean being registered or
+     *                     unregistered.
+     * @param logicalName  The name of the JMXNamespace MBean.
+     * @return a ResourceContext that takes in charge the addition or removal
+     *         of the namespace to or from the NamespaceDispatchInterceptor.
+     */
+    private ResourceContext createJMXNamespaceContext(
+            final JMXNamespace namespace,
+            final ObjectName logicalName) {
+        final Queue<Runnable> doneTaskQueue = new LinkedList<Runnable>();
+        return new ResourceContext() {
+
+            public void registering() {
+                addJMXNamespace(namespace, logicalName, doneTaskQueue);
+            }
+
+            public void unregistered() {
+                removeJMXNamespace(namespace, logicalName,
+                                   doneTaskQueue);
+            }
+
+            public void done() {
+                for (Runnable r : doneTaskQueue) {
+                    try {
+                        r.run();
+                    } catch (RuntimeException x) {
+                        MBEANSERVER_LOGGER.log(Level.FINE,
+                                "Failed to process post queue for "+
+                                logicalName, x);
+                    }
+                }
+            }
+        };
+    }
+
     /**
      * Creates a ResourceContext for a ClassLoader MBean.
      * The resource context makes it possible to add the ClassLoader to
@@ -2065,10 +2182,16 @@
      */
     private ResourceContext makeResourceContextFor(Object resource,
             ObjectName logicalName) {
+        if (resource instanceof JMXNamespace) {
+            return createJMXNamespaceContext((JMXNamespace) resource,
+                    logicalName);
+        }
         if (resource instanceof ClassLoader) {
             return createClassLoaderContext((ClassLoader) resource,
                     logicalName);
         }
         return ResourceContext.NONE;
     }
+
+
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/jmx/interceptor/DispatchInterceptor.java	Wed Jul 05 16:41:34 2017 +0200
@@ -0,0 +1,547 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.jmx.interceptor;
+
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Queue;
+import java.util.Set;
+
+import javax.management.Attribute;
+import javax.management.AttributeList;
+import javax.management.AttributeNotFoundException;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.IntrospectionException;
+import javax.management.InvalidAttributeValueException;
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.NotCompliantMBeanException;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+import javax.management.QueryExp;
+import javax.management.ReflectionException;
+import javax.management.namespace.JMXNamespace;
+
+/**
+ * A dispatcher that dispatches to MBeanServers.
+ * <p><b>
+ * This API is a Sun internal API and is subject to changes without notice.
+ * </b></p>
+ * @since 1.7
+ */
+//
+// This is the base class for implementing dispatchers. We have two concrete
+// dispatcher implementations:
+//
+//   * A NamespaceDispatchInterceptor, which dispatch calls to existing
+//     namespace interceptors
+//   * A DomainDispatchInterceptor, which dispatch calls to existing domain
+//     interceptors.
+//
+// With the JMX Namespaces feature, the JMX MBeanServer is now structured
+// as follows:
+//
+// The JMX MBeanServer delegates to a NamespaceDispatchInterceptor,
+// which either dispatches to a namespace, or delegates to the
+// DomainDispatchInterceptor (if the object name contained no namespace).
+// The DomainDispatchInterceptor in turn either dispatches to a domain (if
+// there is a JMXDomain for that domain) or delegates to the
+// DefaultMBeanServerInterceptor (if there is no JMXDomain for that
+// domain). This makes the following picture:
+//
+//             JMX MBeanServer (outer shell)
+//                          |
+//                          |
+//              NamespaceDispatchInterceptor
+//                   /               \
+//     no namespace in object name?   \
+//                 /                   \
+//                /                   dispatch to namespace
+//         DomainDispatchInterceptor
+//              /              \
+//    no JMXDomain for domain?  \
+//            /                  \
+//           /                   dispatch to domain
+//  DefaultMBeanServerInterceptor
+//         /
+//   invoke locally registered MBean
+//
+//  The logic for maintaining a map of interceptors
+//  and dispatching to impacted interceptor, is implemented in this
+//  base class, which both NamespaceDispatchInterceptor and
+//  DomainDispatchInterceptor extend.
+//
+public abstract class DispatchInterceptor
+        <T extends MBeanServer, N extends JMXNamespace>
+        extends MBeanServerInterceptorSupport {
+
+    /**
+     * This is an abstraction which allows us to handle queryNames
+     * and queryMBeans with the same algorithm. There are some subclasses
+     * where we need to override both queryNames & queryMBeans to apply
+     * the same transformation (usually aggregation of results when
+     * several namespaces/domains are impacted) to both algorithms.
+     * Usually the only thing that varies between the algorithm of
+     * queryNames & the algorithm of queryMBean is the type of objects
+     * in the returned Set. By using a QueryInvoker we can implement the
+     * transformation only once and apply it to both queryNames &
+     * queryMBeans.
+     * @see QueryInterceptor below, and its subclass in
+     * {@link DomainDispatcher}.
+     **/
+    static abstract class QueryInvoker<T> {
+        abstract Set<T> query(MBeanServer mbs,
+                        ObjectName pattern, QueryExp query);
+    }
+
+    /**
+     * Used to perform queryNames. A QueryInvoker that invokes
+     * queryNames on an MBeanServer.
+     **/
+    final static QueryInvoker<ObjectName> queryNamesInvoker =
+            new QueryInvoker<ObjectName>() {
+        Set<ObjectName> query(MBeanServer mbs,
+                        ObjectName pattern, QueryExp query) {
+            return mbs.queryNames(pattern,query);
+        }
+    };
+
+    /**
+     * Used to perform queryMBeans. A QueryInvoker that invokes
+     * queryMBeans on an MBeanServer.
+     **/
+    final static QueryInvoker<ObjectInstance> queryMBeansInvoker =
+            new QueryInvoker<ObjectInstance>() {
+        Set<ObjectInstance> query(MBeanServer mbs,
+                        ObjectName pattern, QueryExp query) {
+            return mbs.queryMBeans(pattern,query);
+        }
+    };
+
+    /**
+     * We use this class to intercept queries.
+     * There's a special case for JMXNamespace MBeans, because
+     * "namespace//*:*" matches both "namespace//domain:k=v" and
+     * "namespace//:type=JMXNamespace".
+     * Therefore, queries may need to be forwarded to more than
+     * on interceptor and the results aggregated...
+     */
+     static class QueryInterceptor {
+        final MBeanServer wrapped;
+        QueryInterceptor(MBeanServer mbs) {
+            wrapped = mbs;
+        }
+        <X> Set<X> query(ObjectName pattern, QueryExp query,
+                QueryInvoker<X> invoker, MBeanServer server) {
+            return invoker.query(server, pattern, query);
+        }
+
+        public Set<ObjectName> queryNames(ObjectName pattern, QueryExp query) {
+            return query(pattern,query,queryNamesInvoker,wrapped);
+        }
+
+        public Set<ObjectInstance> queryMBeans(ObjectName pattern,
+                QueryExp query) {
+            return query(pattern,query,queryMBeansInvoker,wrapped);
+        }
+    }
+
+    // We don't need a ConcurrentHashMap here because getkeys() returns
+    // an array of keys. Therefore there's no risk to have a
+    // ConcurrentModificationException. We must however take into
+    // account the fact that there can be no interceptor for
+    // some of the returned keys if the map is being modified by
+    // another thread, or by a callback within the same thread...
+    // See getKeys() in this class and query() in DomainDispatcher.
+    //
+    private final Map<String,T> handlerMap =
+            Collections.synchronizedMap(
+            new HashMap<String,T>());
+
+    // The key at which an interceptor for accessing the named MBean can be
+    // found in the handlerMap. Note: there doesn't need to be an interceptor
+    // for that key in the Map.
+    //
+    public abstract String getHandlerKey(ObjectName name);
+
+    // Returns an interceptor for that name, or null if there's no interceptor
+    // for that name.
+    abstract MBeanServer getInterceptorOrNullFor(ObjectName name);
+
+    // Returns a QueryInterceptor for that pattern.
+    abstract QueryInterceptor getInterceptorForQuery(ObjectName pattern);
+
+    // Returns the ObjectName of the JMXNamespace (or JMXDomain) for that
+    // key (a namespace or a domain name).
+    abstract ObjectName getHandlerNameFor(String key)
+        throws MalformedObjectNameException;
+
+    // Creates an interceptor for the given key, name, JMXNamespace (or
+    // JMXDomain). Note: this will be either a NamespaceInterceptor
+    // wrapping a JMXNamespace, if this object is an instance of
+    // NamespaceDispatchInterceptor, or a DomainInterceptor wrapping a
+    // JMXDomain, if this object is an instance of DomainDispatchInterceptor.
+    abstract T createInterceptorFor(String key, ObjectName name,
+            N jmxNamespace, Queue<Runnable> postRegisterQueue);
+    //
+    // The next interceptor in the chain.
+    //
+    // For the NamespaceDispatchInterceptor, this the DomainDispatchInterceptor.
+    // For the DomainDispatchInterceptor, this is the
+    // DefaultMBeanServerInterceptor.
+    //
+    // The logic of when to invoke the next interceptor in the chain depends
+    // on the logic of the concrete dispatcher class.
+    //
+    // For instance, the NamespaceDispatchInterceptor invokes the next
+    // interceptor when the object name doesn't contain any namespace.
+    //
+    // On the other hand, the DomainDispatchInterceptor invokes the
+    // next interceptor when there's no interceptor for the accessed domain.
+    //
+    abstract MBeanServer getNextInterceptor();
+
+    // hook for cleanup in subclasses.
+    void interceptorReleased(T interceptor,
+            Queue<Runnable> postDeregisterQueue) {
+        // hook
+    }
+
+    // Hook for subclasses.
+    MBeanServer getInterceptorForCreate(ObjectName name)
+        throws MBeanRegistrationException {
+        final MBeanServer ns = getInterceptorOrNullFor(name);
+        if (ns == null) // name cannot be null here.
+            throw new MBeanRegistrationException(
+                    new IllegalArgumentException("No such MBean handler: " +
+                        getHandlerKey(name) + " for " +name));
+        return ns;
+    }
+
+    // Hook for subclasses.
+    MBeanServer getInterceptorForInstance(ObjectName name)
+        throws InstanceNotFoundException {
+        final MBeanServer ns = getInterceptorOrNullFor(name);
+        if (ns == null) // name cannot be null here.
+            throw new InstanceNotFoundException(String.valueOf(name));
+        return ns;
+    }
+
+    // sanity checks
+    void validateHandlerNameFor(String key, ObjectName name) {
+        if (key == null || key.equals(""))
+            throw new IllegalArgumentException("invalid key for "+name+": "+key);
+        try {
+            final ObjectName handlerName = getHandlerNameFor(key);
+            if (!name.equals(handlerName))
+                throw new IllegalArgumentException("bad handler name: "+name+
+                        ". Should be: "+handlerName);
+        } catch (MalformedObjectNameException x) {
+            throw new IllegalArgumentException(name.toString(),x);
+        }
+    }
+
+    // Called by the DefaultMBeanServerInterceptor when an instance
+    // of JMXNamespace (or a subclass of it) is registered as an MBean.
+    // This method is usually invoked from within the repository lock,
+    // hence the necessity of the postRegisterQueue.
+    public void addNamespace(ObjectName name, N jmxNamespace,
+            Queue<Runnable> postRegisterQueue) {
+        final String key = getHandlerKey(name);
+        validateHandlerNameFor(key,name);
+        synchronized (handlerMap) {
+            final T exists =
+                    handlerMap.get(key);
+            if (exists != null)
+                throw new IllegalArgumentException(key+
+                        ": handler already exists");
+
+            final T ns = createInterceptorFor(key,name,jmxNamespace,
+                    postRegisterQueue);
+            handlerMap.put(key,ns);
+        }
+    }
+
+    // Called by the DefaultMBeanServerInterceptor when an instance
+    // of JMXNamespace (or a subclass of it) is deregistered.
+    // This method is usually invoked from within the repository lock,
+    // hence the necessity of the postDeregisterQueue.
+    public void removeNamespace(ObjectName name, N jmxNamespace,
+            Queue<Runnable> postDeregisterQueue) {
+        final String key = getHandlerKey(name);
+        final T ns;
+        synchronized(handlerMap) {
+            ns = handlerMap.remove(key);
+        }
+        interceptorReleased(ns,postDeregisterQueue);
+    }
+
+    // Get the interceptor for that key.
+    T getInterceptor(String key) {
+        synchronized (handlerMap) {
+            return handlerMap.get(key);
+        }
+    }
+
+    // We return an array of keys, which makes it possible to make
+    // concurrent modifications of the handlerMap, provided that
+    // the code which loops over the keys is prepared to handle null
+    // interceptors.
+    // See declaration of handlerMap above, and see also query() in
+    // DomainDispatcher
+    //
+    public String[] getKeys() {
+        synchronized (handlerMap) {
+            final int size = handlerMap.size();
+            return handlerMap.keySet().toArray(new String[size]);
+        }
+    }
+
+    // From MBeanServer
+    public ObjectInstance createMBean(String className, ObjectName name)
+            throws ReflectionException, InstanceAlreadyExistsException,
+                   MBeanRegistrationException, MBeanException,
+                   NotCompliantMBeanException {
+        return getInterceptorForCreate(name).createMBean(className,name);
+    }
+
+    // From MBeanServer
+    public ObjectInstance createMBean(String className, ObjectName name,
+                                      ObjectName loaderName)
+            throws ReflectionException, InstanceAlreadyExistsException,
+                   MBeanRegistrationException, MBeanException,
+                   NotCompliantMBeanException, InstanceNotFoundException{
+        return getInterceptorForCreate(name).createMBean(className,name,loaderName);
+    }
+
+    // From MBeanServer
+    public ObjectInstance createMBean(String className, ObjectName name,
+                                      Object params[], String signature[])
+            throws ReflectionException, InstanceAlreadyExistsException,
+                   MBeanRegistrationException, MBeanException,
+                   NotCompliantMBeanException{
+        return getInterceptorForCreate(name).
+                createMBean(className,name,params,signature);
+    }
+
+    // From MBeanServer
+    public ObjectInstance createMBean(String className, ObjectName name,
+                                      ObjectName loaderName, Object params[],
+                                      String signature[])
+            throws ReflectionException, InstanceAlreadyExistsException,
+                   MBeanRegistrationException, MBeanException,
+                   NotCompliantMBeanException, InstanceNotFoundException{
+        return getInterceptorForCreate(name).createMBean(className,name,loaderName,
+                                                   params,signature);
+    }
+
+    // From MBeanServer
+    public ObjectInstance registerMBean(Object object, ObjectName name)
+            throws InstanceAlreadyExistsException, MBeanRegistrationException,
+                   NotCompliantMBeanException {
+        return getInterceptorForCreate(name).registerMBean(object,name);
+    }
+
+    // From MBeanServer
+    public void unregisterMBean(ObjectName name)
+            throws InstanceNotFoundException, MBeanRegistrationException {
+        getInterceptorForInstance(name).unregisterMBean(name);
+    }
+
+    // From MBeanServer
+    public ObjectInstance getObjectInstance(ObjectName name)
+            throws InstanceNotFoundException {
+        return getInterceptorForInstance(name).getObjectInstance(name);
+    }
+
+    // From MBeanServer
+    public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query) {
+        final QueryInterceptor mbs =
+                getInterceptorForQuery(name);
+        if (mbs == null)  return Collections.emptySet();
+        else return mbs.queryMBeans(name,query);
+    }
+
+    // From MBeanServer
+    public Set<ObjectName> queryNames(ObjectName name, QueryExp query) {
+        final QueryInterceptor mbs =
+                getInterceptorForQuery(name);
+        if (mbs == null)  return Collections.emptySet();
+        else return mbs.queryNames(name,query);
+    }
+
+    // From MBeanServer
+    public boolean isRegistered(ObjectName name) {
+        final MBeanServer mbs = getInterceptorOrNullFor(name);
+        if (mbs == null) return false;
+        else return mbs.isRegistered(name);
+    }
+
+    // From MBeanServer
+    public Integer getMBeanCount() {
+        return getNextInterceptor().getMBeanCount();
+    }
+
+    // From MBeanServer
+    public Object getAttribute(ObjectName name, String attribute)
+            throws MBeanException, AttributeNotFoundException,
+                   InstanceNotFoundException, ReflectionException {
+        return getInterceptorForInstance(name).getAttribute(name,attribute);
+    }
+
+    // From MBeanServer
+    public AttributeList getAttributes(ObjectName name, String[] attributes)
+            throws InstanceNotFoundException, ReflectionException {
+        return getInterceptorForInstance(name).getAttributes(name,attributes);
+    }
+
+    // From MBeanServer
+    public void setAttribute(ObjectName name, Attribute attribute)
+            throws InstanceNotFoundException, AttributeNotFoundException,
+                   InvalidAttributeValueException, MBeanException,
+                   ReflectionException {
+        getInterceptorForInstance(name).setAttribute(name,attribute);
+    }
+
+    // From MBeanServer
+    public AttributeList setAttributes(ObjectName name,
+                                       AttributeList attributes)
+        throws InstanceNotFoundException, ReflectionException {
+        return getInterceptorForInstance(name).setAttributes(name,attributes);
+    }
+
+    // From MBeanServer
+    public Object invoke(ObjectName name, String operationName,
+                         Object params[], String signature[])
+            throws InstanceNotFoundException, MBeanException,
+                   ReflectionException {
+        return getInterceptorForInstance(name).invoke(name,operationName,params,
+                signature);
+    }
+
+    // From MBeanServer
+    public String getDefaultDomain() {
+        return getNextInterceptor().getDefaultDomain();
+    }
+
+    /**
+     * Returns the list of domains in which any MBean is currently
+     * registered.
+     */
+    public abstract String[] getDomains();
+
+    // From MBeanServer
+    public void addNotificationListener(ObjectName name,
+                                        NotificationListener listener,
+                                        NotificationFilter filter,
+                                        Object handback)
+            throws InstanceNotFoundException {
+        getInterceptorForInstance(name).addNotificationListener(name,listener,filter,
+                handback);
+    }
+
+
+    // From MBeanServer
+    public void addNotificationListener(ObjectName name,
+                                        ObjectName listener,
+                                        NotificationFilter filter,
+                                        Object handback)
+            throws InstanceNotFoundException {
+        getInterceptorForInstance(name).addNotificationListener(name,listener,filter,
+                handback);
+    }
+
+    // From MBeanServer
+    public void removeNotificationListener(ObjectName name,
+                                           ObjectName listener)
+        throws InstanceNotFoundException, ListenerNotFoundException {
+        getInterceptorForInstance(name).removeNotificationListener(name,listener);
+    }
+
+    // From MBeanServer
+    public void removeNotificationListener(ObjectName name,
+                                           ObjectName listener,
+                                           NotificationFilter filter,
+                                           Object handback)
+            throws InstanceNotFoundException, ListenerNotFoundException {
+        getInterceptorForInstance(name).removeNotificationListener(name,listener,filter,
+                handback);
+    }
+
+
+    // From MBeanServer
+    public void removeNotificationListener(ObjectName name,
+                                           NotificationListener listener)
+            throws InstanceNotFoundException, ListenerNotFoundException {
+        getInterceptorForInstance(name).removeNotificationListener(name,listener);
+    }
+
+    // From MBeanServer
+    public void removeNotificationListener(ObjectName name,
+                                           NotificationListener listener,
+                                           NotificationFilter filter,
+                                           Object handback)
+            throws InstanceNotFoundException, ListenerNotFoundException {
+        getInterceptorForInstance(name).removeNotificationListener(name,listener,filter,
+                handback);
+    }
+
+    // From MBeanServer
+    public MBeanInfo getMBeanInfo(ObjectName name)
+            throws InstanceNotFoundException, IntrospectionException,
+                   ReflectionException {
+        return getInterceptorForInstance(name).getMBeanInfo(name);
+    }
+
+
+    // From MBeanServer
+    public boolean isInstanceOf(ObjectName name, String className)
+            throws InstanceNotFoundException {
+        return getInterceptorForInstance(name).isInstanceOf(name,className);
+    }
+
+    // From MBeanServer
+    public ClassLoader getClassLoaderFor(ObjectName mbeanName)
+        throws InstanceNotFoundException {
+        return getInterceptorForInstance(mbeanName).getClassLoaderFor(mbeanName);
+    }
+
+    // From MBeanServer
+    public ClassLoader getClassLoader(ObjectName loaderName)
+        throws InstanceNotFoundException {
+        return getInterceptorForInstance(loaderName).getClassLoader(loaderName);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/jmx/interceptor/DomainDispatchInterceptor.java	Wed Jul 05 16:41:34 2017 +0200
@@ -0,0 +1,322 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.jmx.interceptor;
+
+import com.sun.jmx.defaults.JmxProperties;
+import com.sun.jmx.mbeanserver.MBeanInstantiator;
+import com.sun.jmx.mbeanserver.Repository;
+import com.sun.jmx.mbeanserver.Util;
+import com.sun.jmx.namespace.DomainInterceptor;
+import java.util.Queue;
+import java.util.Set;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerDelegate;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.QueryExp;
+import javax.management.namespace.JMXDomain;
+import static javax.management.namespace.JMXNamespaces.NAMESPACE_SEPARATOR;
+
+/**
+ * A dispatcher that dispatch incoming MBeanServer requests to
+ * DomainInterceptors.
+ * <p><b>
+ * This API is a Sun internal API and is subject to changes without notice.
+ * </b></p>
+ * @since 1.7
+ */
+//
+// See comments in  DispatchInterceptor.
+//
+class DomainDispatchInterceptor
+        extends DispatchInterceptor<DomainInterceptor, JMXDomain> {
+
+    /**
+     * A logger for this class.
+     **/
+    private static final Logger LOG = JmxProperties.NAMESPACE_LOGGER;
+
+    private static final ObjectName ALL_DOMAINS =
+            JMXDomain.getDomainObjectName("*");
+
+
+    /**
+     *  A QueryInterceptor that perform & aggregates queries spanning several
+     *  domains.
+     */
+    final static class AggregatingQueryInterceptor extends QueryInterceptor {
+
+        private final DomainDispatchInterceptor parent;
+        AggregatingQueryInterceptor(DomainDispatchInterceptor dispatcher) {
+            super(dispatcher.localNamespace);
+            parent = dispatcher;
+        }
+
+        /**
+         * Perform queryNames or queryMBeans, depending on which QueryInvoker
+         * is passed as argument. This is closures without closures.
+         **/
+        @Override
+        <T> Set<T> query(ObjectName pattern, QueryExp query,
+                QueryInvoker<T> invoker, MBeanServer localNamespace) {
+            final Set<T> local = invoker.query(localNamespace, pattern, query);
+
+            // Add all matching MBeans from local namespace.
+            final Set<T> res = Util.cloneSet(local);
+
+            final boolean all = (pattern == null ||
+                    pattern.getDomain().equals("*"));
+            if (pattern == null) pattern = ObjectName.WILDCARD;
+
+            final String domain = pattern.getDomain();
+
+            // If there's no domain pattern, just include the pattern's domain.
+            // Otherwiae, loop over all virtual domains (parent.getKeys()).
+            final String[] keys =
+                (pattern.isDomainPattern() ?
+                    parent.getKeys() : new String[]{domain});
+
+            // Add all matching MBeans from each virtual domain
+            //
+            for (String key : keys) {
+                // Only invoke those virtual domain which are selected
+                // by the domain pattern
+                //
+                if (!all && !Util.isDomainSelected(key, domain))
+                    continue;
+
+                try {
+                    final MBeanServer mbs = parent.getInterceptor(key);
+
+                    // mbs can be null if the interceptor was removed
+                    // concurrently...
+                    // See handlerMap and getKeys() in DispatchInterceptor
+                    //
+                    if (mbs == null) continue;
+
+                    // If the domain is selected, we can replace the pattern
+                    // by the actual domain. This is safer if we want to avoid
+                    // a domain (which could be backed up by an MBeanServer) to
+                    // return names from outside the domain.
+                    // So instead of asking the domain handler for "foo" to
+                    // return all names which match "?o*:type=Bla,*" we're
+                    // going to ask it to return all names which match
+                    // "foo:type=Bla,*"
+                    //
+                    final ObjectName subPattern = pattern.withDomain(key);
+                    res.addAll(invoker.query(mbs, subPattern, query));
+                } catch (Exception x) {
+                    LOG.finest("Ignoring exception " +
+                            "when attempting to query namespace "+key+": "+x);
+                    continue;
+                }
+            }
+            return res;
+        }
+    }
+
+    private final DefaultMBeanServerInterceptor localNamespace;
+    private final String mbeanServerName;
+    private final MBeanServerDelegate delegate;
+
+    /**
+     * Creates a DomainDispatchInterceptor with the specified
+     * repository instance.
+     *
+     * @param outer A pointer to the MBeanServer object that must be
+     *        passed to the MBeans when invoking their
+     *        {@link javax.management.MBeanRegistration} interface.
+     * @param delegate A pointer to the MBeanServerDelegate associated
+     *        with the new MBeanServer. The new MBeanServer must register
+     *        this MBean in its MBean repository.
+     * @param instantiator The MBeanInstantiator that will be used to
+     *        instantiate MBeans and take care of class loading issues.
+     * @param repository The repository to use for this MBeanServer
+     */
+    public DomainDispatchInterceptor(MBeanServer         outer,
+                            MBeanServerDelegate delegate,
+                            MBeanInstantiator   instantiator,
+                            Repository          repository,
+                            NamespaceDispatchInterceptor namespaces)  {
+           localNamespace = new DefaultMBeanServerInterceptor(outer,
+                   delegate, instantiator,repository,namespaces);
+           mbeanServerName = Util.getMBeanServerSecurityName(delegate);
+           this.delegate = delegate;
+    }
+
+    final boolean isLocalHandlerNameFor(String domain,
+            ObjectName handlerName) {
+        if (domain == null) return true;
+        return handlerName.getDomain().equals(domain) &&
+               JMXDomain.TYPE_ASSIGNMENT.equals(
+               handlerName.getKeyPropertyListString());
+    }
+
+    @Override
+    void validateHandlerNameFor(String key, ObjectName name) {
+        super.validateHandlerNameFor(key,name);
+        final String[] domains = localNamespace.getDomains();
+        for (int i=0;i<domains.length;i++) {
+            if (domains[i].equals(key))
+                throw new IllegalArgumentException("domain "+key+
+                        " is not empty");
+        }
+    }
+
+    @Override
+    final MBeanServer getInterceptorOrNullFor(ObjectName name) {
+        if (name == null) return localNamespace;
+        final String domain = name.getDomain();
+        if (domain.endsWith(NAMESPACE_SEPARATOR)) return localNamespace;
+        if (domain.contains(NAMESPACE_SEPARATOR)) return null;
+        final String localDomain = domain;
+        if (isLocalHandlerNameFor(localDomain,name)) {
+            LOG.finer("dispatching to local namespace");
+            return localNamespace;
+        }
+        final DomainInterceptor ns = getInterceptor(localDomain);
+        if (ns == null) {
+            if (LOG.isLoggable(Level.FINER)) {
+                LOG.finer("dispatching to local namespace: " + localDomain);
+            }
+            return getNextInterceptor();
+        }
+        if (LOG.isLoggable(Level.FINER)) {
+            LOG.finer("dispatching to domain: " + localDomain);
+        }
+        return ns;
+    }
+
+    private boolean multipleQuery(ObjectName pattern) {
+        if (pattern == null) return true;
+        if (pattern.isDomainPattern()) return true;
+
+        try {
+            // This is a bit of a hack. If there's any chance that a JMXDomain
+            // MBean name is selected by the given pattern then we must include
+            // the local namespace in our search.
+            // Returning true will have this effect.
+            if (pattern.apply(ALL_DOMAINS.withDomain(pattern.getDomain())))
+                return true;
+        } catch (MalformedObjectNameException x) {
+            // should not happen
+            throw new IllegalArgumentException(String.valueOf(pattern), x);
+        }
+        return false;
+    }
+
+    @Override
+    final QueryInterceptor getInterceptorForQuery(ObjectName pattern) {
+
+        // Check if we need to aggregate.
+        if (multipleQuery(pattern))
+            return new AggregatingQueryInterceptor(this);
+
+        // We don't need to aggregate: do the "simple" thing...
+        final String domain = pattern.getDomain();
+
+        // Do we have a virtual domain?
+        final DomainInterceptor ns = getInterceptor(domain);
+        if (ns != null) {
+            if (LOG.isLoggable(Level.FINER))
+                LOG.finer("dispatching to domain: " + domain);
+            return new QueryInterceptor(ns);
+        }
+
+        // We don't have a virtual domain. Send to local domains.
+        if (LOG.isLoggable(Level.FINER))
+             LOG.finer("dispatching to local namespace: " + domain);
+        return new QueryInterceptor(localNamespace);
+    }
+
+    @Override
+    final ObjectName getHandlerNameFor(String key)
+        throws MalformedObjectNameException {
+        return JMXDomain.getDomainObjectName(key);
+    }
+
+    @Override
+    final public String getHandlerKey(ObjectName name) {
+        return name.getDomain();
+    }
+
+    @Override
+    final DomainInterceptor createInterceptorFor(String key,
+            ObjectName name, JMXDomain handler,
+            Queue<Runnable> postRegisterQueue) {
+        final DomainInterceptor ns =
+                new DomainInterceptor(mbeanServerName,handler,key);
+        ns.addPostRegisterTask(postRegisterQueue, delegate);
+        if (LOG.isLoggable(Level.FINER)) {
+            LOG.finer("DomainInterceptor created: "+ns);
+        }
+        return ns;
+    }
+
+    @Override
+    final void interceptorReleased(DomainInterceptor interceptor,
+            Queue<Runnable> postDeregisterQueue) {
+        interceptor.addPostDeregisterTask(postDeregisterQueue, delegate);
+    }
+
+    @Override
+    final DefaultMBeanServerInterceptor getNextInterceptor() {
+        return localNamespace;
+    }
+
+    /**
+     * Returns the list of domains in which any MBean is currently
+     * registered.
+     */
+    @Override
+    public String[] getDomains() {
+        // A JMXDomain is registered in its own domain.
+        // Therefore, localNamespace.getDomains() contains all domains.
+        // In addition, localNamespace will perform the necessary
+        // MBeanPermission checks for getDomains().
+        //
+        return localNamespace.getDomains();
+    }
+
+    /**
+     * Returns the number of MBeans registered in the MBean server.
+     */
+    @Override
+    public Integer getMBeanCount() {
+        int count = getNextInterceptor().getMBeanCount().intValue();
+        final String[] keys = getKeys();
+        for (String key:keys) {
+            final MBeanServer mbs = getInterceptor(key);
+            if (mbs == null) continue;
+            count += mbs.getMBeanCount().intValue();
+        }
+        return Integer.valueOf(count);
+    }
+}
--- a/jdk/src/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java	Wed Jul 05 16:41:34 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,35 +25,14 @@
 
 package com.sun.jmx.interceptor;
 
-import java.util.Set;
 
-// RI import
-import javax.management.DynamicMBean;
-import javax.management.AttributeNotFoundException;
+import java.io.ObjectInputStream;
+import javax.management.InstanceNotFoundException;
 import javax.management.MBeanException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.management.OperationsException;
 import javax.management.ReflectionException;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
-import javax.management.QueryExp;
-import javax.management.NotificationListener;
-import javax.management.NotificationFilter;
-import javax.management.ListenerNotFoundException;
-import javax.management.IntrospectionException;
-import javax.management.OperationsException;
-import javax.management.MBeanNotificationInfo;
-import javax.management.JMRuntimeException;
-import javax.management.InstanceNotFoundException;
-import javax.management.NotCompliantMBeanException;
-import javax.management.MBeanRegistrationException;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.ObjectName;
-import javax.management.ObjectInstance;
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.RuntimeOperationsException;
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanServerDelegate;
 import javax.management.loading.ClassLoaderRepository;
 
 /**
@@ -85,618 +64,67 @@
  *
  * @since 1.5
  */
-public interface MBeanServerInterceptor extends MBeanServerConnection {
+public interface MBeanServerInterceptor extends MBeanServer {
     /**
-     * Instantiates and registers an MBean in the MBean server.  The
-     * MBean server will use its {@link
-     * javax.management.loading.ClassLoaderRepository Default Loader
-     * Repository} to load the class of the MBean.  An object name is
-     * associated to the MBean.  If the object name given is null, the
-     * MBean must provide its own name by implementing the {@link
-     * javax.management.MBeanRegistration MBeanRegistration} interface
-     * and returning the name from the {@link
-     * javax.management.MBeanRegistration#preRegister preRegister} method.
-     *
-     * @param className The class name of the MBean to be instantiated.
-     * @param name The object name of the MBean. May be null.
-     * @param params An array containing the parameters of the
-     * constructor to be invoked.
-     * @param signature An array containing the signature of the
-     * constructor to be invoked.
-     *
-     * @return An <CODE>ObjectInstance</CODE>, containing the
-     * <CODE>ObjectName</CODE> and the Java class name of the newly
-     * instantiated MBean.
-     *
-     * @exception ReflectionException Wraps a
-     * <CODE>java.lang.ClassNotFoundException</CODE> or a
-     * <CODE>java.lang.Exception</CODE> that occurred when trying to
-     * invoke the MBean's constructor.
-     * @exception InstanceAlreadyExistsException The MBean is already
-     * under the control of the MBean server.
-     * @exception MBeanRegistrationException The
-     * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
-     * interface) method of the MBean has thrown an exception. The
-     * MBean will not be registered.
-     * @exception MBeanException The constructor of the MBean has
-     * thrown an exception
-     * @exception RuntimeOperationsException Wraps a
-     * <CODE>java.lang.IllegalArgumentException</CODE>: The className
-     * passed in parameter is null, the <CODE>ObjectName</CODE> passed
-     * in parameter contains a pattern or no <CODE>ObjectName</CODE>
-     * is specified for the MBean.
+     * This method should never be called.
+     * Usually hrows UnsupportedOperationException.
      */
-    public ObjectInstance createMBean(String className, ObjectName name,
-                                      Object params[], String signature[])
-            throws ReflectionException, InstanceAlreadyExistsException,
-                   MBeanRegistrationException, MBeanException,
-                   NotCompliantMBeanException;
+    public Object instantiate(String className)
+            throws ReflectionException, MBeanException;
+    /**
+     * This method should never be called.
+     * Usually throws UnsupportedOperationException.
+     */
+    public Object instantiate(String className, ObjectName loaderName)
+            throws ReflectionException, MBeanException,
+            InstanceNotFoundException;
+    /**
+     * This method should never be called.
+     * Usually throws UnsupportedOperationException.
+     */
+    public Object instantiate(String className, Object[] params,
+            String[] signature) throws ReflectionException, MBeanException;
 
     /**
-     * Instantiates and registers an MBean in the MBean server.  The
-     * class loader to be used is identified by its object name. An
-     * object name is associated to the MBean. If the object name of
-     * the loader is not specified, the ClassLoader that loaded the
-     * MBean server will be used.  If the MBean object name given is
-     * null, the MBean must provide its own name by implementing the
-     * {@link javax.management.MBeanRegistration MBeanRegistration}
-     * interface and returning the name from the {@link
-     * javax.management.MBeanRegistration#preRegister preRegister} method.
-     *
-     * @param className The class name of the MBean to be instantiated.
-     * @param name The object name of the MBean. May be null.
-     * @param params An array containing the parameters of the
-     * constructor to be invoked.
-     * @param signature An array containing the signature of the
-     * constructor to be invoked.
-     * @param loaderName The object name of the class loader to be used.
-     *
-     * @return An <CODE>ObjectInstance</CODE>, containing the
-     * <CODE>ObjectName</CODE> and the Java class name of the newly
-     * instantiated MBean.
-     *
-     * @exception ReflectionException Wraps a
-     * <CODE>java.lang.ClassNotFoundException</CODE> or a
-     * <CODE>java.lang.Exception</CODE> that occurred when trying to
-     * invoke the MBean's constructor.
-     * @exception InstanceAlreadyExistsException The MBean is already
-     * under the control of the MBean server.
-     * @exception MBeanRegistrationException The
-     * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
-     * interface) method of the MBean has thrown an exception. The
-     * MBean will not be registered.
-     * @exception MBeanException The constructor of the MBean has
-     * thrown an exception
-     * @exception InstanceNotFoundException The specified class loader
-     * is not registered in the MBean server.
-     * @exception RuntimeOperationsException Wraps a
-     * <CODE>java.lang.IllegalArgumentException</CODE>: The className
-     * passed in parameter is null, the <CODE>ObjectName</CODE> passed
-     * in parameter contains a pattern or no <CODE>ObjectName</CODE>
-     * is specified for the MBean.
-     *
+     * This method should never be called.
+     * Usually throws UnsupportedOperationException.
      */
-    public ObjectInstance createMBean(String className, ObjectName name,
-                                      ObjectName loaderName, Object params[],
-                                      String signature[])
-            throws ReflectionException, InstanceAlreadyExistsException,
-                   MBeanRegistrationException, MBeanException,
-                   NotCompliantMBeanException, InstanceNotFoundException;
+    public Object instantiate(String className, ObjectName loaderName,
+            Object[] params, String[] signature)
+            throws ReflectionException, MBeanException,
+            InstanceNotFoundException;
 
     /**
-     * Registers a pre-existing object as an MBean with the MBean
-     * server. If the object name given is null, the MBean must
-     * provide its own name by implementing the {@link
-     * javax.management.MBeanRegistration MBeanRegistration} interface
-     * and returning the name from the {@link
-     * javax.management.MBeanRegistration#preRegister preRegister} method.
-     *
-     * @param object The  MBean to be registered as an MBean.
-     * @param name The object name of the MBean. May be null.
-     *
-     * @return The <CODE>ObjectInstance</CODE> for the MBean that has
-     * been registered.
-     *
-     * @exception InstanceAlreadyExistsException The MBean is already
-     * under the control of the MBean server.
-     * @exception MBeanRegistrationException The
-     * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
-     * interface) method of the MBean has thrown an exception. The
-     * MBean will not be registered.
-     * @exception NotCompliantMBeanException This object is not a JMX
-     * compliant MBean
-     * @exception RuntimeOperationsException Wraps a
-     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
-     * passed in parameter is null or no object name is specified.
+     * This method should never be called.
+     * Usually throws UnsupportedOperationException.
      */
-    public ObjectInstance registerMBean(Object object, ObjectName name)
-            throws InstanceAlreadyExistsException, MBeanRegistrationException,
-                   NotCompliantMBeanException;
+    @Deprecated
+    public ObjectInputStream deserialize(ObjectName name, byte[] data)
+            throws InstanceNotFoundException, OperationsException;
 
     /**
-     * Unregisters an MBean from the MBean server. The MBean is
-     * identified by its object name. Once the method has been
-     * invoked, the MBean may no longer be accessed by its object
-     * name.
-     *
-     * @param name The object name of the MBean to be unregistered.
-     *
-     * @exception InstanceNotFoundException The MBean specified is not
-     * registered in the MBean server.
-     * @exception MBeanRegistrationException The preDeregister
-     * ((<CODE>MBeanRegistration</CODE> interface) method of the MBean
-     * has thrown an exception.
-     * @exception RuntimeOperationsException Wraps a
-     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
-     * name in parameter is null or the MBean you are when trying to
-     * unregister is the {@link javax.management.MBeanServerDelegate
-     * MBeanServerDelegate} MBean.
-     *
+     * This method should never be called.
+     * Usually throws UnsupportedOperationException.
      */
-    public void unregisterMBean(ObjectName name)
-            throws InstanceNotFoundException, MBeanRegistrationException;
+    @Deprecated
+    public ObjectInputStream deserialize(String className, byte[] data)
+            throws OperationsException, ReflectionException;
 
     /**
-     * Gets the <CODE>ObjectInstance</CODE> for a given MBean
-     * registered with the MBean server.
-     *
-     * @param name The object name of the MBean.
-     *
-     * @return The <CODE>ObjectInstance</CODE> associated to the MBean
-     * specified by <VAR>name</VAR>.
-     *
-     * @exception InstanceNotFoundException The MBean specified is not
-     * registered in the MBean server.
+     * This method should never be called.
+     * Usually hrows UnsupportedOperationException.
      */
-    public ObjectInstance getObjectInstance(ObjectName name)
-            throws InstanceNotFoundException;
+    @Deprecated
+    public ObjectInputStream deserialize(String className,
+            ObjectName loaderName, byte[] data)
+            throws InstanceNotFoundException, OperationsException,
+            ReflectionException;
 
     /**
-     * Gets MBeans controlled by the MBean server. This method allows
-     * any of the following to be obtained: All MBeans, a set of
-     * MBeans specified by pattern matching on the
-     * <CODE>ObjectName</CODE> and/or a Query expression, a specific
-     * MBean. When the object name is null or no domain and key
-     * properties are specified, all objects are to be selected (and
-     * filtered if a query is specified). It returns the set of
-     * <CODE>ObjectInstance</CODE> objects (containing the
-     * <CODE>ObjectName</CODE> and the Java Class name) for the
-     * selected MBeans.
-     *
-     * @param name The object name pattern identifying the MBeans to
-     * be retrieved. If null or no domain and key properties are
-     * specified, all the MBeans registered will be retrieved.
-     * @param query The query expression to be applied for selecting
-     * MBeans. If null no query expression will be applied for
-     * selecting MBeans.
-     *
-     * @return A set containing the <CODE>ObjectInstance</CODE>
-     * objects for the selected MBeans.  If no MBean satisfies the
-     * query an empty list is returned.
+     * This method should never be called.
+     * Usually throws UnsupportedOperationException.
      */
-    public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query);
-
-    /**
-     * Gets the names of MBeans controlled by the MBean server. This
-     * method enables any of the following to be obtained: The names
-     * of all MBeans, the names of a set of MBeans specified by
-     * pattern matching on the <CODE>ObjectName</CODE> and/or a Query
-     * expression, a specific MBean name (equivalent to testing
-     * whether an MBean is registered). When the object name is null
-     * or no domain and key properties are specified, all objects are
-     * selected (and filtered if a query is specified). It returns the
-     * set of ObjectNames for the MBeans selected.
-     *
-     * @param name The object name pattern identifying the MBean names
-     * to be retrieved. If null oror no domain and key properties are
-     * specified, the name of all registered MBeans will be retrieved.
-     * @param query The query expression to be applied for selecting
-     * MBeans. If null no query expression will be applied for
-     * selecting MBeans.
-     *
-     * @return A set containing the ObjectNames for the MBeans
-     * selected.  If no MBean satisfies the query, an empty list is
-     * returned.
-     */
-    public Set<ObjectName> queryNames(ObjectName name, QueryExp query);
-
-    /**
-     * Checks whether an MBean, identified by its object name, is
-     * already registered with the MBean server.
-     *
-     * @param name The object name of the MBean to be checked.
-     *
-     * @return True if the MBean is already registered in the MBean
-     * server, false otherwise.
-     *
-     * @exception RuntimeOperationsException Wraps a
-     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
-     * name in parameter is null.
-     */
-    public boolean isRegistered(ObjectName name);
-
-    /**
-     * Returns the number of MBeans registered in the MBean server.
-     */
-    public Integer getMBeanCount();
-
-    /**
-     * Gets the value of a specific attribute of a named MBean. The MBean
-     * is identified by its object name.
-     *
-     * @param name The object name of the MBean from which the
-     * attribute is to be retrieved.
-     * @param attribute A String specifying the name of the attribute
-     * to be retrieved.
-     *
-     * @return  The value of the retrieved attribute.
-     *
-     * @exception AttributeNotFoundException The attribute specified
-     * is not accessible in the MBean.
-     * @exception MBeanException Wraps an exception thrown by the
-     * MBean's getter.
-     * @exception InstanceNotFoundException The MBean specified is not
-     * registered in the MBean server.
-     * @exception ReflectionException Wraps a
-     * <CODE>java.lang.Exception</CODE> thrown when trying to invoke
-     * the setter.
-     * @exception RuntimeOperationsException Wraps a
-     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
-     * name in parameter is null or the attribute in parameter is
-     * null.
-     */
-    public Object getAttribute(ObjectName name, String attribute)
-            throws MBeanException, AttributeNotFoundException,
-                   InstanceNotFoundException, ReflectionException;
-
-    /**
-     * Enables the values of several attributes of a named MBean. The MBean
-     * is identified by its object name.
-     *
-     * @param name The object name of the MBean from which the
-     * attributes are retrieved.
-     * @param attributes A list of the attributes to be retrieved.
-     *
-     * @return The list of the retrieved attributes.
-     *
-     * @exception InstanceNotFoundException The MBean specified is not
-     * registered in the MBean server.
-     * @exception ReflectionException An exception occurred when
-     * trying to invoke the getAttributes method of a Dynamic MBean.
-     * @exception RuntimeOperationsException Wrap a
-     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
-     * name in parameter is null or attributes in parameter is null.
-     */
-    public AttributeList getAttributes(ObjectName name, String[] attributes)
-            throws InstanceNotFoundException, ReflectionException;
-
-    /**
-     * Sets the value of a specific attribute of a named MBean. The MBean
-     * is identified by its object name.
-     *
-     * @param name The name of the MBean within which the attribute is
-     * to be set.
-     * @param attribute The identification of the attribute to be set
-     * and the value it is to be set to.
-     *
-     * @exception InstanceNotFoundException The MBean specified is not
-     * registered in the MBean server.
-     * @exception AttributeNotFoundException The attribute specified
-     * is not accessible in the MBean.
-     * @exception InvalidAttributeValueException The value specified
-     * for the attribute is not valid.
-     * @exception MBeanException Wraps an exception thrown by the
-     * MBean's setter.
-     * @exception ReflectionException Wraps a
-     * <CODE>java.lang.Exception</CODE> thrown when trying to invoke
-     * the setter.
-     * @exception RuntimeOperationsException Wraps a
-     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
-     * name in parameter is null or the attribute in parameter is
-     * null.
-     */
-    public void setAttribute(ObjectName name, Attribute attribute)
-            throws InstanceNotFoundException, AttributeNotFoundException,
-                   InvalidAttributeValueException, MBeanException,
-                   ReflectionException;
-
-
-
-    /**
-     * Sets the values of several attributes of a named MBean. The MBean is
-     * identified by its object name.
-     *
-     * @param name The object name of the MBean within which the
-     * attributes are to be set.
-     * @param attributes A list of attributes: The identification of
-     * the attributes to be set and the values they are to be set to.
-     *
-     * @return The list of attributes that were set, with their new
-     * values.
-     *
-     * @exception InstanceNotFoundException The MBean specified is not
-     * registered in the MBean server.
-     * @exception ReflectionException An exception occurred when
-     * trying to invoke the getAttributes method of a Dynamic MBean.
-     * @exception RuntimeOperationsException Wraps a
-     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
-     * name in parameter is null or attributes in parameter is null.
-     */
-    public AttributeList setAttributes(ObjectName name,
-                                       AttributeList attributes)
-        throws InstanceNotFoundException, ReflectionException;
-
-    /**
-     * Invokes an operation on an MBean.
-     *
-     * @param name The object name of the MBean on which the method is
-     * to be invoked.
-     * @param operationName The name of the operation to be invoked.
-     * @param params An array containing the parameters to be set when
-     * the operation is invoked
-     * @param signature An array containing the signature of the
-     * operation. The class objects will be loaded using the same
-     * class loader as the one used for loading the MBean on which the
-     * operation was invoked.
-     *
-     * @return The object returned by the operation, which represents
-     * the result ofinvoking the operation on the MBean specified.
-     *
-     * @exception InstanceNotFoundException The MBean specified is not
-     * registered in the MBean server.
-     * @exception MBeanException Wraps an exception thrown by the
-     * MBean's invoked method.
-     * @exception ReflectionException Wraps a
-     * <CODE>java.lang.Exception</CODE> thrown while trying to invoke
-     * the method.
-     */
-    public Object invoke(ObjectName name, String operationName,
-                         Object params[], String signature[])
-            throws InstanceNotFoundException, MBeanException,
-                   ReflectionException;
-
-    /**
-     * Returns the default domain used for naming the MBean.
-     * The default domain name is used as the domain part in the ObjectName
-     * of MBeans if no domain is specified by the user.
-     */
-    public String getDefaultDomain();
-
-    /**
-     * Returns the list of domains in which any MBean is currently
-     * registered.
-     */
-    public String[] getDomains();
-
-    /**
-     * <p>Adds a listener to a registered MBean.</p>
-     *
-     * <P> A notification emitted by an MBean will be forwarded by the
-     * MBeanServer to the listener.  If the source of the notification
-     * is a reference to an MBean object, the MBean server will replace it
-     * by that MBean's ObjectName.  Otherwise the source is unchanged.
-     *
-     * @param name The name of the MBean on which the listener should
-     * be added.
-     * @param listener The listener object which will handle the
-     * notifications emitted by the registered MBean.
-     * @param filter The filter object. If filter is null, no
-     * filtering will be performed before handling notifications.
-     * @param handback The context to be sent to the listener when a
-     * notification is emitted.
-     *
-     * @exception InstanceNotFoundException The MBean name provided
-     * does not match any of the registered MBeans.
-     */
-    public void addNotificationListener(ObjectName name,
-                                        NotificationListener listener,
-                                        NotificationFilter filter,
-                                        Object handback)
-            throws InstanceNotFoundException;
-
-
-    /**
-     * <p>Adds a listener to a registered MBean.</p>
-     *
-     * <p>A notification emitted by an MBean will be forwarded by the
-     * MBeanServer to the listener.  If the source of the notification
-     * is a reference to an MBean object, the MBean server will
-     * replace it by that MBean's ObjectName.  Otherwise the source is
-     * unchanged.</p>
-     *
-     * <p>The listener object that receives notifications is the one
-     * that is registered with the given name at the time this method
-     * is called.  Even if it is subsequently unregistered, it will
-     * continue to receive notifications.</p>
-     *
-     * @param name The name of the MBean on which the listener should
-     * be added.
-     * @param listener The object name of the listener which will
-     * handle the notifications emitted by the registered MBean.
-     * @param filter The filter object. If filter is null, no
-     * filtering will be performed before handling notifications.
-     * @param handback The context to be sent to the listener when a
-     * notification is emitted.
-     *
-     * @exception InstanceNotFoundException The MBean name of the
-     * notification listener or of the notification broadcaster does
-     * not match any of the registered MBeans.
-     * @exception RuntimeOperationsException Wraps an {@link
-     * IllegalArgumentException}.  The MBean named by
-     * <code>listener</code> exists but does not implement the {@link
-     * NotificationListener} interface.
-     * @exception IOException A communication problem occurred when
-     * talking to the MBean server.
-     */
-    public void addNotificationListener(ObjectName name,
-                                        ObjectName listener,
-                                        NotificationFilter filter,
-                                        Object handback)
-            throws InstanceNotFoundException;
-
-    /**
-     * Removes a listener from a registered MBean.
-     *
-     * <P> If the listener is registered more than once, perhaps with
-     * different filters or callbacks, this method will remove all
-     * those registrations.
-     *
-     * @param name The name of the MBean on which the listener should
-     * be removed.
-     * @param listener The object name of the listener to be removed.
-     *
-     * @exception InstanceNotFoundException The MBean name provided
-     * does not match any of the registered MBeans.
-     * @exception ListenerNotFoundException The listener is not
-     * registered in the MBean.
-     */
-    public void removeNotificationListener(ObjectName name,
-                                           ObjectName listener)
-        throws InstanceNotFoundException, ListenerNotFoundException;
-
-    /**
-     * <p>Removes a listener from a registered MBean.</p>
-     *
-     * <p>The MBean must have a listener that exactly matches the
-     * given <code>listener</code>, <code>filter</code>, and
-     * <code>handback</code> parameters.  If there is more than one
-     * such listener, only one is removed.</p>
-     *
-     * <p>The <code>filter</code> and <code>handback</code> parameters
-     * may be null if and only if they are null in a listener to be
-     * removed.</p>
-     *
-     * @param name The name of the MBean on which the listener should
-     * be removed.
-     * @param listener A listener that was previously added to this
-     * MBean.
-     * @param filter The filter that was specified when the listener
-     * was added.
-     * @param handback The handback that was specified when the
-     * listener was added.
-     *
-     * @exception InstanceNotFoundException The MBean name provided
-     * does not match any of the registered MBeans.
-     * @exception ListenerNotFoundException The listener is not
-     * registered in the MBean, or it is not registered with the given
-     * filter and handback.
-     */
-    public void removeNotificationListener(ObjectName name,
-                                           ObjectName listener,
-                                           NotificationFilter filter,
-                                           Object handback)
-            throws InstanceNotFoundException, ListenerNotFoundException;
-
-
-    /**
-     * <p>Removes a listener from a registered MBean.</p>
-     *
-     * <P> If the listener is registered more than once, perhaps with
-     * different filters or callbacks, this method will remove all
-     * those registrations.
-     *
-     * @param name The name of the MBean on which the listener should
-     * be removed.
-     * @param listener The listener object which will handle the
-     * notifications emitted by the registered MBean.
-     *
-     * @exception InstanceNotFoundException The MBean name provided
-     * does not match any of the registered MBeans.
-     * @exception ListenerNotFoundException The listener is not
-     * registered in the MBean.
-     */
-    public void removeNotificationListener(ObjectName name,
-                                           NotificationListener listener)
-            throws InstanceNotFoundException, ListenerNotFoundException;
-
-    /**
-     * <p>Removes a listener from a registered MBean.</p>
-     *
-     * <p>The MBean must have a listener that exactly matches the
-     * given <code>listener</code>, <code>filter</code>, and
-     * <code>handback</code> parameters.  If there is more than one
-     * such listener, only one is removed.</p>
-     *
-     * <p>The <code>filter</code> and <code>handback</code> parameters
-     * may be null if and only if they are null in a listener to be
-     * removed.</p>
-     *
-     * @param name The name of the MBean on which the listener should
-     * be removed.
-     * @param listener A listener that was previously added to this
-     * MBean.
-     * @param filter The filter that was specified when the listener
-     * was added.
-     * @param handback The handback that was specified when the
-     * listener was added.
-     *
-     * @exception InstanceNotFoundException The MBean name provided
-     * does not match any of the registered MBeans.
-     * @exception ListenerNotFoundException The listener is not
-     * registered in the MBean, or it is not registered with the given
-     * filter and handback.
-     */
-    public void removeNotificationListener(ObjectName name,
-                                           NotificationListener listener,
-                                           NotificationFilter filter,
-                                           Object handback)
-            throws InstanceNotFoundException, ListenerNotFoundException;
-
-    /**
-     * This method discovers the attributes and operations that an
-     * MBean exposes for management.
-     *
-     * @param name The name of the MBean to analyze
-     *
-     * @return An instance of <CODE>MBeanInfo</CODE> allowing the
-     * retrieval of all attributes and operations of this MBean.
-     *
-     * @exception IntrospectionException An exception occurred during
-     * introspection.
-     * @exception InstanceNotFoundException The MBean specified was
-     * not found.
-     * @exception ReflectionException An exception occurred when
-     * trying to invoke the getMBeanInfo of a Dynamic MBean.
-     */
-    public MBeanInfo getMBeanInfo(ObjectName name)
-            throws InstanceNotFoundException, IntrospectionException,
-                   ReflectionException;
-
-
-    /**
-     * Returns true if the MBean specified is an instance of the
-     * specified class, false otherwise.
-     *
-     * @param name The <CODE>ObjectName</CODE> of the MBean.
-     * @param className The name of the class.
-     *
-     * @return true if the MBean specified is an instance of the
-     * specified class, false otherwise.
-     *
-     * @exception InstanceNotFoundException The MBean specified is not
-     * registered in the MBean server.
-     */
-    public boolean isInstanceOf(ObjectName name, String className)
-            throws InstanceNotFoundException;
-
-    /**
-     * <p>Return the {@link java.lang.ClassLoader} that was used for
-     * loading the class of the named MBean.
-     * @param mbeanName The ObjectName of the MBean.
-     * @return The ClassLoader used for that MBean.
-     * @exception InstanceNotFoundException if the named MBean is not found.
-     */
-    public ClassLoader getClassLoaderFor(ObjectName mbeanName)
-        throws InstanceNotFoundException;
-
-    /**
-     * <p>Return the named {@link java.lang.ClassLoader}.
-     * @param loaderName The ObjectName of the ClassLoader.
-     * @return The named ClassLoader.
-     * @exception InstanceNotFoundException if the named ClassLoader is
-     * not found.
-     */
-    public ClassLoader getClassLoader(ObjectName loaderName)
-        throws InstanceNotFoundException;
+    public ClassLoaderRepository getClassLoaderRepository();
 
 }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptorSupport.java	Wed Jul 05 16:41:34 2017 +0200
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.jmx.interceptor;
+
+import java.io.ObjectInputStream;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.ObjectName;
+import javax.management.OperationsException;
+import javax.management.ReflectionException;
+import javax.management.loading.ClassLoaderRepository;
+
+/**
+ * An abstract class for MBeanServerInterceptorSupport.
+ * Some methods in MBeanServerInterceptor should never be called.
+ * This base class provides an implementation of these methods that simply
+ * throw an {@link UnsupportedOperationException}.
+ * <p><b>
+ * This API is a Sun internal API and is subject to changes without notice.
+ * </b></p>
+ * @since 1.7
+ */
+public abstract class MBeanServerInterceptorSupport
+        implements MBeanServerInterceptor {
+    /**
+     * This method should never be called.
+     * Throws UnsupportedOperationException.
+     */
+    public Object instantiate(String className)
+            throws ReflectionException, MBeanException {
+        throw new UnsupportedOperationException("Not applicable.");
+    }
+
+    /**
+     * This method should never be called.
+     * Throws UnsupportedOperationException.
+     */
+    public Object instantiate(String className, ObjectName loaderName)
+            throws ReflectionException, MBeanException,
+            InstanceNotFoundException {
+        throw new UnsupportedOperationException("Not applicable.");
+    }
+
+    /**
+     * This method should never be called.
+     * Throws UnsupportedOperationException.
+     */
+    public Object instantiate(String className, Object[] params,
+            String[] signature) throws ReflectionException, MBeanException {
+        throw new UnsupportedOperationException("Not applicable.");
+    }
+
+    /**
+     * This method should never be called.
+     * Throws UnsupportedOperationException.
+     */
+    public Object instantiate(String className, ObjectName loaderName,
+            Object[] params, String[] signature)
+            throws ReflectionException, MBeanException,
+            InstanceNotFoundException {
+        throw new UnsupportedOperationException("Not applicable.");
+    }
+
+    /**
+     * This method should never be called.
+     * Throws UnsupportedOperationException.
+     */
+    @Deprecated
+    public ObjectInputStream deserialize(ObjectName name, byte[] data)
+            throws InstanceNotFoundException, OperationsException {
+        throw new UnsupportedOperationException("Not applicable.");
+    }
+
+    /**
+     * This method should never be called.
+     * Throws UnsupportedOperationException.
+     */
+    @Deprecated
+    public ObjectInputStream deserialize(String className, byte[] data)
+            throws OperationsException, ReflectionException {
+        throw new UnsupportedOperationException("Not applicable.");
+    }
+
+    /**
+     * This method should never be called.
+     * Throws UnsupportedOperationException.
+     */
+    @Deprecated
+    public ObjectInputStream deserialize(String className,
+            ObjectName loaderName, byte[] data)
+            throws InstanceNotFoundException, OperationsException,
+            ReflectionException {
+        throw new UnsupportedOperationException("Not applicable.");
+    }
+
+    /**
+     * This method should never be called.
+     * Throws UnsupportedOperationException.
+     */
+    public ClassLoaderRepository getClassLoaderRepository() {
+        throw new UnsupportedOperationException("Not applicable.");
+    }
+
+}
--- a/jdk/src/share/classes/com/sun/jmx/interceptor/MBeanServerSupport.java	Fri Sep 12 14:35:51 2008 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1341 +0,0 @@
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.jmx.interceptor;
-
-import com.sun.jmx.mbeanserver.Util;
-import java.io.ObjectInputStream;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.AttributeNotFoundException;
-import javax.management.DynamicMBean;
-import javax.management.DynamicWrapperMBean;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InstanceNotFoundException;
-import javax.management.IntrospectionException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.JMRuntimeException;
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.NotCompliantMBeanException;
-import javax.management.NotificationBroadcaster;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-import javax.management.OperationsException;
-import javax.management.QueryEval;
-import javax.management.QueryExp;
-import javax.management.ReflectionException;
-import javax.management.RuntimeOperationsException;
-import javax.management.loading.ClassLoaderRepository;
-
-/**
- * <p>Base class for custom implementations of the {@link MBeanServer}
- * interface. The commonest use of this class is as the {@linkplain
- * JMXNamespace#getSourceServer() source server} for a {@link
- * JMXNamespace}, although this class can be used anywhere an {@code
- * MBeanServer} instance is required. Note that the usual ways to
- * obtain an {@code MBeanServer} instance are either to use {@link
- * java.lang.management.ManagementFactory#getPlatformMBeanServer()
- * ManagementFactory.getPlatformMBeanServer()} or to use the {@code
- * newMBeanServer} or {@code createMBeanServer} methods from {@link
- * javax.management.MBeanServerFactory MBeanServerFactory}. {@code
- * MBeanServerSupport} is for certain cases where those are not
- * appropriate.</p>
- *
- * <p>There are two main use cases for this class: <a
- * href="#special-purpose">special-purpose MBeanServer implementations</a>,
- * and <a href="#virtual">namespaces containing Virtual MBeans</a>. The next
- * sections explain these use cases.</p>
- *
- * <p>In the simplest case, a subclass needs to implement only two methods:</p>
- *
- * <ul>
- *     <li>
- *         {@link #getNames getNames} which returns the name of
- *         all MBeans handled by this {@code MBeanServer}.
- *     </li>
- *     <li>
- *         {@link #getDynamicMBeanFor getDynamicMBeanFor} which returns a
- *         {@link DynamicMBean} that can be used to invoke operations and
- *         obtain meta data (MBeanInfo) on a given MBean.
- *     </li>
- * </ul>
- *
- * <p>Subclasses can create such {@link DynamicMBean} MBeans on the fly - for
- * instance, using the class {@link javax.management.StandardMBean}, just for
- * the duration of an MBeanServer method call.</p>
- *
- * <h4 id="special-purpose">Special-purpose MBeanServer implementations</h4>
- *
- * <p>In some cases
- * the general-purpose {@code MBeanServer} that you get from
- * {@link javax.management.MBeanServerFactory MBeanServerFactory} is not
- * appropriate.  You might need different security checks, or you might
- * want a mock {@code MBeanServer} suitable for use in tests, or you might
- * want a simplified and optimized {@code MBeanServer} for a special purpose.</p>
- *
- * <p>As an example of a special-purpose {@code MBeanServer}, the class {@link
- * javax.management.QueryNotificationFilter QueryNotificationFilter} constructs
- * an {@code MBeanServer} instance every time it filters a notification,
- * with just one MBean that represents the notification. Although it could
- * use {@code MBeanServerFactory.newMBeanServer}, a special-purpose {@code
- * MBeanServer} will be quicker to create, use less memory, and have simpler
- * methods that execute faster.</p>
- *
- * <p>Here is an example of a special-purpose {@code MBeanServer}
- * implementation that contains exactly one MBean, which is specified at the
- * time of creation.</p>
- *
- * <pre>
- * public class SingletonMBeanServer extends MBeanServerSupport {
- *     private final ObjectName objectName;
- *     private final DynamicMBean mbean;
- *
- *     public SingletonMBeanServer(ObjectName objectName, DynamicMBean mbean) {
- *         this.objectName = objectName;
- *         this.mbean = mbean;
- *     }
- *
- *     &#64;Override
- *     protected {@code Set<ObjectName>} {@link #getNames getNames}() {
- *         return Collections.singleton(objectName);
- *     }
- *
- *     &#64;Override
- *     public DynamicMBean {@link #getDynamicMBeanFor
- *                                getDynamicMBeanFor}(ObjectName name)
- *             throws InstanceNotFoundException {
- *         if (objectName.equals(name))
- *             return mbean;
- *         else
- *             throw new InstanceNotFoundException(name);
- *     }
- * }
- * </pre>
- *
- * <p>Using this class, you could make an {@code MBeanServer} that contains
- * a {@link javax.management.timer.Timer Timer} MBean like this:</p>
- *
- * <pre>
- *     Timer timer = new Timer();
- *     DynamicMBean mbean = new {@link javax.management.StandardMBean
- *                                     StandardMBean}(timer, TimerMBean.class);
- *     ObjectName name = new ObjectName("com.example:type=Timer");
- *     MBeanServer timerMBS = new SingletonMBeanServer(name, mbean);
- * </pre>
- *
- * <p>When {@code getDynamicMBeanFor} always returns the same object for the
- * same name, as here, notifications work in the expected way: if the object
- * is a {@link NotificationEmitter} then listeners can be added using
- * {@link MBeanServer#addNotificationListener(ObjectName, NotificationListener,
- * NotificationFilter, Object) MBeanServer.addNotificationListener}.  If
- * {@code getDynamicMBeanFor} does not always return the same object for the
- * same name, more work is needed to make notifications work, as described
- * <a href="#notifs">below</a>.</p>
- *
- * <h4 id="virtual">Namespaces containing Virtual MBeans</h4>
- *
- * <p>Virtual MBeans are MBeans that do not exist as Java objects,
- * except transiently while they are being accessed.  This is useful when
- * there might be very many of them, or when keeping track of their creation
- * and deletion might be expensive or hard.  For example, you might have one
- * MBean per system process.  With an ordinary {@code MBeanServer}, you would
- * have to list the system processes in order to create an MBean object for
- * each one, and you would have to track the arrival and departure of system
- * processes in order to create or delete the corresponding MBeans.  With
- * Virtual MBeans, you only need the MBean for a given process at the exact
- * point where it is referenced with a call such as
- * {@link MBeanServer#getAttribute MBeanServer.getAttribute}.</p>
- *
- * <p>Here is an example of an {@code MBeanServer} implementation that has
- * one MBean for every system property.  The system property {@code "java.home"}
- * is represented by the MBean called {@code
- * com.example:type=Property,name="java.home"}, with an attribute called
- * {@code Value} that is the value of the property.</p>
- *
- * <pre>
- * public interface PropertyMBean {
- *     public String getValue();
- * }
- *
- * <a name="PropsMBS"></a>public class PropsMBS extends MBeanServerSupport {
- *     private static ObjectName newObjectName(String name) {
- *         try {
- *             return new ObjectName(name);
- *         } catch (MalformedObjectNameException e) {
- *             throw new AssertionError(e);
- *         }
- *     }
- *
- *     public static class PropertyImpl implements PropertyMBean {
- *         private final String name;
- *
- *         public PropertyImpl(String name) {
- *             this.name = name;
- *         }
- *
- *         public String getValue() {
- *             return System.getProperty(name);
- *         }
- *     }
- *
- *     &#64;Override
- *     public DynamicMBean {@link #getDynamicMBeanFor
- *                                getDynamicMBeanFor}(ObjectName name)
- *             throws InstanceNotFoundException {
- *
- *         // Check that the name is a legal one for a Property MBean
- *         ObjectName namePattern = newObjectName(
- *                     "com.example:type=Property,name=\"*\"");
- *         if (!namePattern.apply(name))
- *             throw new InstanceNotFoundException(name);
- *
- *         // Extract the name of the property that the MBean corresponds to
- *         String propName = ObjectName.unquote(name.getKeyProperty("name"));
- *         if (System.getProperty(propName) == null)
- *             throw new InstanceNotFoundException(name);
- *
- *         // Construct and return a transient MBean object
- *         PropertyMBean propMBean = new PropertyImpl(propName);
- *         return new StandardMBean(propMBean, PropertyMBean.class, false);
- *     }
- *
- *     &#64;Override
- *     protected {@code Set<ObjectName>} {@link #getNames getNames}() {
- *         {@code Set<ObjectName> names = new TreeSet<ObjectName>();}
- *         Properties props = System.getProperties();
- *         for (String propName : props.stringPropertyNames()) {
- *             ObjectName objectName = newObjectName(
- *                     "com.example:type=Property,name=" +
- *                     ObjectName.quote(propName));
- *             names.add(objectName);
- *         }
- *         return names;
- *     }
- * }
- * </pre>
- *
- * <p id="virtual-notif-example">Because the {@code getDynamicMBeanFor} method
- * returns a different object every time it is called, the default handling
- * of notifications will not work, as explained <a href="#notifs">below</a>.
- * In this case it does not matter, because the object returned by {@code
- * getDynamicMBeanFor} is not a {@code NotificationEmitter}, so {@link
- * MBeanServer#addNotificationListener(ObjectName, NotificationListener,
- * NotificationFilter, Object) MBeanServer.addNotificationListener} will
- * always fail. But if we wanted to extend {@code PropsMBS} so that the MBean
- * for property {@code "foo"} emitted a notification every time that property
- * changed, we would need to do it as shown below. (Because there is no API to
- * be informed when a property changes, this code assumes that some other code
- * calls the {@code propertyChanged} method every time a property changes.)</p>
- *
- * <pre>
- * public class PropsMBS {
- *     ...as <a href="#PropsMBS">above</a>...
- *
- *     private final {@link VirtualEventManager} vem = new VirtualEventManager();
- *
- *     &#64;Override
- *     public NotificationEmitter {@link #getNotificationEmitterFor
- *                                       getNotificationEmitterFor}(
- *             ObjectName name) throws InstanceNotFoundException {
- *         getDynamicMBeanFor(name);  // check that the name is valid
- *         return vem.{@link VirtualEventManager#getNotificationEmitterFor
- *                           getNotificationEmitterFor}(name);
- *     }
- *
- *     public void propertyChanged(String name, String newValue) {
- *         ObjectName objectName = newObjectName(
- *                 "com.example:type=Property,name=" + ObjectName.quote(name));
- *         Notification n = new Notification(
- *                 "com.example.property.changed", objectName, 0L,
- *                 "Property " + name + " changed");
- *         n.setUserData(newValue);
- *         vem.{@link VirtualEventManager#publish publish}(objectName, n);
- *     }
- * }
- * </pre>
- *
- * <h4 id="creation">MBean creation and deletion</h4>
- *
- * <p>MBean creation through {@code MBeanServer.createMBean} is disabled
- * by default. Subclasses which need to support MBean creation
- * through {@code createMBean} need to implement a single method {@link
- * #createMBean(String, ObjectName, ObjectName, Object[], String[],
- * boolean)}.</p>
- *
- * <p>Similarly MBean registration and unregistration through {@code
- * registerMBean} and {@code unregisterMBean} are disabled by default.
- * Subclasses which need to support MBean registration and
- * unregistration will need to implement {@link #registerMBean registerMBean}
- * and {@link #unregisterMBean unregisterMBean}.</p>
- *
- * <h4 id="notifs">Notifications</h4>
- *
- * <p>By default {@link MBeanServer#addNotificationListener(ObjectName,
- * NotificationListener, NotificationFilter, Object) addNotificationListener}
- * is accepted for an MBean <em>{@code name}</em> if {@link #getDynamicMBeanFor
- * getDynamicMBeanFor}<code>(<em>name</em>)</code> returns an object that is a
- * {@link NotificationEmitter}.  That is appropriate if
- * {@code getDynamicMBeanFor}<code>(<em>name</em>)</code> always returns the
- * same object for the same <em>{@code name}</em>.  But with
- * Virtual MBeans, every call to {@code getDynamicMBeanFor} returns a new object,
- * which is discarded as soon as the MBean request has finished.
- * So a listener added to that object would be immediately forgotten.</p>
- *
- * <p>The simplest way for a subclass that defines Virtual MBeans
- * to support notifications is to create a private {@link VirtualEventManager}
- * and override the method {@link
- * #getNotificationEmitterFor getNotificationEmitterFor} as follows:</p>
- *
- * <pre>
- *     private final VirtualEventManager vem = new VirtualEventManager();
- *
- *     &#64;Override
- *     public NotificationEmitter getNotificationEmitterFor(
- *             ObjectName name) throws InstanceNotFoundException {
- *         // Check that the name is a valid Virtual MBean.
- *         // This is the easiest way to do that, but not always the
- *         // most efficient:
- *         getDynamicMBeanFor(name);
- *
- *         // Return an object that supports add/removeNotificationListener
- *         // through the VirtualEventManager.
- *         return vem.getNotificationEmitterFor(name);
- *     }
- * </pre>
- *
- * <p>A notification <em>{@code n}</em> can then be sent from the Virtual MBean
- * called <em>{@code name}</em> by calling {@link VirtualEventManager#publish
- * vem.publish}<code>(<em>name</em>, <em>n</em>)</code>.  See the example
- * <a href="#virtual-notif-example">above</a>.</p>
- *
- * @since Java SE 7
- */
-public abstract class MBeanServerSupport implements MBeanServer {
-
-    /**
-     * A logger for this class.
-     */
-    private static final Logger LOG =
-            Logger.getLogger(MBeanServerSupport.class.getName());
-
-    /**
-     * <p>Make a new {@code MBeanServerSupport} instance.</p>
-     */
-    protected MBeanServerSupport() {
-    }
-
-    /**
-     * <p>Returns a dynamically created handle that makes it possible to
-     * access the named MBean for the duration of a method call.</p>
-     *
-     * <p>An easy way to create such a {@link DynamicMBean} handle is, for
-     * instance, to create a temporary MXBean instance and to wrap it in
-     * an instance of
-     * {@link javax.management.StandardMBean}.
-     * This handle should remain valid for the duration of the call
-     * but can then be discarded.</p>
-     * @param name the name of the MBean for which a request was received.
-     * @return a {@link DynamicMBean} handle that can be used to invoke
-     * operations on the named MBean.
-     * @throws InstanceNotFoundException if no such MBean is supposed
-     *         to exist.
-     */
-    public abstract DynamicMBean getDynamicMBeanFor(ObjectName name)
-                        throws InstanceNotFoundException;
-
-    /**
-     * <p>Subclasses should implement this method to return
-     * the names of all MBeans handled by this object instance.</p>
-     *
-     * <p>The object returned by getNames() should be safely {@linkplain
-     * Set#iterator iterable} even in the presence of other threads that may
-     * cause the set of names to change. Typically this means one of the
-     * following:</p>
-     *
-     * <ul>
-     * <li>the returned set of names is always the same; or
-     * <li>the returned set of names is an object such as a {@link
-     * java.util.concurrent.CopyOnWriteArraySet CopyOnWriteArraySet} that is
-     * safely iterable even if the set is changed by other threads; or
-     * <li>a new Set is constructed every time this method is called.
-     * </ul>
-     *
-     * @return the names of all MBeans handled by this object.
-     */
-    protected abstract Set<ObjectName> getNames();
-
-    /**
-     * <p>List names matching the given pattern.
-     * The default implementation of this method calls {@link #getNames()}
-     * and returns the subset of those names matching {@code pattern}.</p>
-     *
-     * @param pattern an ObjectName pattern
-     * @return the list of MBean names that match the given pattern.
-     */
-    protected Set<ObjectName> getMatchingNames(ObjectName pattern) {
-        return Util.filterMatchingNames(pattern, getNames());
-    }
-
-    /**
-     * <p>Returns a {@link NotificationEmitter} which can be used to
-     * subscribe or unsubscribe for notifications with the named
-     * mbean.</p>
-     *
-     * <p>The default implementation of this method calls {@link
-     * #getDynamicMBeanFor getDynamicMBeanFor(name)} and returns that object
-     * if it is a {@code NotificationEmitter}, otherwise null. See <a
-     * href="#notifs">above</a> for further discussion of notification
-     * handling.</p>
-     *
-     * @param name The name of the MBean whose notifications are being
-     * subscribed, or unsuscribed.
-     *
-     * @return A {@link NotificationEmitter} that can be used to subscribe or
-     * unsubscribe for notifications emitted by the named MBean, or {@code
-     * null} if the MBean does not emit notifications and should not be
-     * considered as a {@code NotificationEmitter}.
-     *
-     * @throws InstanceNotFoundException if {@code name} is not the name of
-     * an MBean in this {@code MBeanServer}.
-     */
-    public NotificationEmitter getNotificationEmitterFor(ObjectName name)
-            throws InstanceNotFoundException {
-        DynamicMBean mbean = getDynamicMBeanFor(name);
-        if (mbean instanceof NotificationEmitter)
-            return (NotificationEmitter) mbean;
-        else
-            return null;
-    }
-
-    private NotificationEmitter getNonNullNotificationEmitterFor(
-            ObjectName name)
-            throws InstanceNotFoundException {
-        NotificationEmitter emitter = getNotificationEmitterFor(name);
-        if (emitter == null) {
-            IllegalArgumentException iae = new IllegalArgumentException(
-                    "Not a NotificationEmitter: " + name);
-            throw new RuntimeOperationsException(iae);
-        }
-        return emitter;
-    }
-
-    /**
-     * <p>Creates a new MBean in the MBean name space.
-     * This operation is not supported in this base class implementation.</p>
-     * The default implementation of this method always throws an {@link
-     * UnsupportedOperationException}
-     * wrapped in a {@link RuntimeOperationsException}.</p>
-     *
-     * <p>Subclasses may redefine this method to provide an implementation.
-     * All the various flavors of {@code MBeanServer.createMBean} methods
-     * will eventually call this method. A subclass that wishes to
-     * support MBean creation through {@code createMBean} thus only
-     * needs to provide an implementation for this one method.
-     *
-     * @param className The class name of the MBean to be instantiated.
-     * @param name The object name of the MBean. May be null.
-     * @param params An array containing the parameters of the
-     * constructor to be invoked.
-     * @param signature An array containing the signature of the
-     * constructor to be invoked.
-     * @param loaderName The object name of the class loader to be used.
-     * @param useCLR This parameter is {@code true} when this method
-     *        is called from one of the {@code MBeanServer.createMBean} methods
-     *        whose signature does not include the {@code ObjectName} of an
-     *        MBean class loader to use for loading the MBean class.
-     *
-     * @return An <CODE>ObjectInstance</CODE>, containing the
-     * <CODE>ObjectName</CODE> and the Java class name of the newly
-     * instantiated MBean.  If the contained <code>ObjectName</code>
-     * is <code>n</code>, the contained Java class name is
-     * <code>{@link javax.management.MBeanServer#getMBeanInfo
-     * getMBeanInfo(n)}.getClassName()</code>.
-     *
-     * @exception ReflectionException Wraps a
-     * <CODE>java.lang.ClassNotFoundException</CODE> or a
-     * <CODE>java.lang.Exception</CODE> that occurred when trying to
-     * invoke the MBean's constructor.
-     * @exception InstanceAlreadyExistsException The MBean is already
-     * under the control of the MBean server.
-     * @exception MBeanRegistrationException The
-     * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
-     * interface) method of the MBean has thrown an exception. The
-     * MBean will not be registered.
-     * @exception MBeanException The constructor of the MBean has
-     * thrown an exception
-     * @exception NotCompliantMBeanException This class is not a JMX
-     * compliant MBean
-     * @exception InstanceNotFoundException The specified class loader
-     * is not registered in the MBean server.
-     * @exception RuntimeOperationsException Wraps either:
-     * <ul>
-     * <li>a <CODE>java.lang.IllegalArgumentException</CODE>: The className
-     * passed in parameter is null, the <CODE>ObjectName</CODE> passed in
-     * parameter contains a pattern or no <CODE>ObjectName</CODE> is specified
-     * for the MBean; or</li>
-     * <li>an {@code UnsupportedOperationException} if creating MBeans is not
-     * supported by this {@code MBeanServer} implementation.
-     * </ul>
-     */
-    public ObjectInstance createMBean(String className,
-            ObjectName name, ObjectName loaderName, Object[] params,
-            String[] signature, boolean useCLR)
-            throws ReflectionException, InstanceAlreadyExistsException,
-            MBeanRegistrationException, MBeanException,
-            NotCompliantMBeanException, InstanceNotFoundException {
-        throw newUnsupportedException("createMBean");
-    }
-
-
-    /**
-     * <p>Attempts to determine whether the named MBean should be
-     * considered as an instance of a given class.  The default implementation
-     * of this method calls {@link #getDynamicMBeanFor getDynamicMBeanFor(name)}
-     * to get an MBean object.  Then its behaviour is the same as the standard
-     * {@link MBeanServer#isInstanceOf MBeanServer.isInstanceOf} method.</p>
-     *
-     * {@inheritDoc}
-     */
-    public boolean isInstanceOf(ObjectName name, String className)
-        throws InstanceNotFoundException {
-
-        final DynamicMBean instance = nonNullMBeanFor(name);
-
-        try {
-            final String mbeanClassName = instance.getMBeanInfo().getClassName();
-
-            if (mbeanClassName.equals(className))
-                return true;
-
-            final Object resource;
-            final ClassLoader cl;
-            if (instance instanceof DynamicWrapperMBean) {
-                DynamicWrapperMBean d = (DynamicWrapperMBean) instance;
-                resource = d.getWrappedObject();
-                cl = d.getWrappedClassLoader();
-            } else {
-                resource = instance;
-                cl = instance.getClass().getClassLoader();
-            }
-
-            final Class<?> classNameClass = Class.forName(className, false, cl);
-
-            if (classNameClass.isInstance(resource))
-                return true;
-
-            if (classNameClass == NotificationBroadcaster.class ||
-                    classNameClass == NotificationEmitter.class) {
-                try {
-                    getNotificationEmitterFor(name);
-                    return true;
-                } catch (Exception x) {
-                    LOG.finest("MBean " + name +
-                            " is not a notification emitter. Ignoring: "+x);
-                    return false;
-                }
-            }
-
-            final Class<?> resourceClass = Class.forName(mbeanClassName, false, cl);
-            return classNameClass.isAssignableFrom(resourceClass);
-        } catch (Exception x) {
-            /* Could be SecurityException or ClassNotFoundException */
-            LOG.logp(Level.FINEST,
-                    MBeanServerSupport.class.getName(),
-                    "isInstanceOf", "Exception calling isInstanceOf", x);
-            return false;
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method returns the string
-     * "DefaultDomain".</p>
-     */
-    public String getDefaultDomain() {
-        return "DefaultDomain";
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method returns
-     * {@link #getNames()}.size().</p>
-     */
-    public Integer getMBeanCount() {
-        return getNames().size();
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method first calls {@link #getNames
-     * getNames()} to get a list of all MBean names,
-     * and from this set of names, derives the set of domains which contain
-     * MBeans.</p>
-     */
-    public String[] getDomains() {
-        final Set<ObjectName> names = getNames();
-        final Set<String> res = new TreeSet<String>();
-        for (ObjectName n : names) {
-            if (n == null) continue; // not allowed but you never know.
-            res.add(n.getDomain());
-        }
-        return res.toArray(new String[res.size()]);
-    }
-
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method will first
-     * call {@link
-     *    #getDynamicMBeanFor getDynamicMBeanFor(name)} to obtain a handle
-     * to the named MBean,
-     * and then call {@link DynamicMBean#getAttribute getAttribute}
-     * on that {@link DynamicMBean} handle.</p>
-     *
-     * @throws RuntimeOperationsException {@inheritDoc}
-     */
-    public Object getAttribute(ObjectName name, String attribute)
-        throws MBeanException, AttributeNotFoundException,
-               InstanceNotFoundException, ReflectionException {
-        final DynamicMBean mbean = nonNullMBeanFor(name);
-        return mbean.getAttribute(attribute);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method will first
-     * call {@link #getDynamicMBeanFor getDynamicMBeanFor(name)}
-     * to obtain a handle to the named MBean,
-     * and then call {@link DynamicMBean#setAttribute setAttribute}
-     * on that {@link DynamicMBean} handle.</p>
-     *
-     * @throws RuntimeOperationsException {@inheritDoc}
-     */
-    public void setAttribute(ObjectName name, Attribute attribute)
-        throws InstanceNotFoundException, AttributeNotFoundException,
-            InvalidAttributeValueException, MBeanException,
-            ReflectionException {
-        final DynamicMBean mbean = nonNullMBeanFor(name);
-        mbean.setAttribute(attribute);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method will first
-     * call {@link #getDynamicMBeanFor getDynamicMBeanFor(name)} to obtain a
-     * handle to the named MBean,
-     * and then call {@link DynamicMBean#getAttributes getAttributes}
-     * on that {@link DynamicMBean} handle.</p>
-     *
-     * @throws RuntimeOperationsException {@inheritDoc}
-     */
-    public AttributeList getAttributes(ObjectName name,
-            String[] attributes) throws InstanceNotFoundException,
-            ReflectionException {
-        final DynamicMBean mbean = nonNullMBeanFor(name);
-        return mbean.getAttributes(attributes);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method will first
-     * call {@link #getDynamicMBeanFor getDynamicMBeanFor(name)} to obtain a
-     * handle to the named MBean,
-     * and then call {@link DynamicMBean#setAttributes setAttributes}
-     * on that {@link DynamicMBean} handle.</p>
-     *
-     * @throws RuntimeOperationsException {@inheritDoc}
-     */
-    public AttributeList setAttributes(ObjectName name, AttributeList attributes)
-        throws InstanceNotFoundException, ReflectionException {
-        final DynamicMBean mbean = nonNullMBeanFor(name);
-        return mbean.setAttributes(attributes);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method will first
-     * call {@link #getDynamicMBeanFor getDynamicMBeanFor(name)} to obtain a
-     * handle to the named MBean,
-     * and then call {@link DynamicMBean#invoke invoke}
-     * on that {@link DynamicMBean} handle.</p>
-     */
-    public Object invoke(ObjectName name, String operationName,
-                Object[] params, String[] signature)
-                throws InstanceNotFoundException, MBeanException,
-                       ReflectionException {
-        final DynamicMBean mbean = nonNullMBeanFor(name);
-        return mbean.invoke(operationName, params, signature);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method will first
-     * call {@link #getDynamicMBeanFor getDynamicMBeanFor(name)} to obtain a
-     * handle to the named MBean,
-     * and then call {@link DynamicMBean#getMBeanInfo getMBeanInfo}
-     * on that {@link DynamicMBean} handle.</p>
-     */
-    public MBeanInfo getMBeanInfo(ObjectName name)
-        throws InstanceNotFoundException, IntrospectionException,
-               ReflectionException {
-        final DynamicMBean mbean = nonNullMBeanFor(name);
-        return mbean.getMBeanInfo();
-   }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method will call
-     * {@link #getDynamicMBeanFor getDynamicMBeanFor(name)}.<!--
-     * -->{@link DynamicMBean#getMBeanInfo getMBeanInfo()}.<!--
-     * -->{@link MBeanInfo#getClassName getClassName()} to get the
-     * class name to combine with {@code name} to produce a new
-     * {@code ObjectInstance}.</p>
-     */
-    public ObjectInstance getObjectInstance(ObjectName name)
-            throws InstanceNotFoundException {
-        final DynamicMBean mbean = nonNullMBeanFor(name);
-        final String className = mbean.getMBeanInfo().getClassName();
-        return new ObjectInstance(name, className);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method will first call {@link
-     * #getDynamicMBeanFor getDynamicMBeanFor(name)} to obtain a handle to the
-     * named MBean. If {@code getDynamicMBeanFor} returns an object, {@code
-     * isRegistered} will return true. If {@code getDynamicMBeanFor} returns
-     * null or throws {@link InstanceNotFoundException}, {@code isRegistered}
-     * will return false.</p>
-     *
-     * @throws RuntimeOperationsException {@inheritDoc}
-     */
-    public boolean isRegistered(ObjectName name) {
-        try {
-            final DynamicMBean mbean = getDynamicMBeanFor(name);
-            return mbean!=null;
-        } catch (InstanceNotFoundException x) {
-            if (LOG.isLoggable(Level.FINEST))
-                LOG.finest("MBean "+name+" is not registered: "+x);
-            return false;
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method will first
-     * call {@link #queryNames queryNames}
-     * to get a list of all matching MBeans, and then, for each returned name,
-     * call {@link #getObjectInstance getObjectInstance(name)}.</p>
-     */
-    public Set<ObjectInstance> queryMBeans(ObjectName pattern, QueryExp query) {
-        final Set<ObjectName> names = queryNames(pattern, query);
-        if (names.isEmpty()) return Collections.emptySet();
-        final Set<ObjectInstance> mbeans = new HashSet<ObjectInstance>();
-        for (ObjectName name : names) {
-            try {
-                mbeans.add(getObjectInstance(name));
-            } catch (SecurityException x) { // DLS: OK
-                continue;
-            } catch (InstanceNotFoundException x) { // DLS: OK
-                continue;
-            }
-        }
-        return mbeans;
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method calls {@link #getMatchingNames
-     * getMatchingNames(pattern)} to obtain a list of MBeans matching
-     * the given name pattern. If the {@code query} parameter is null,
-     * this will be the result. Otherwise, it will evaluate the
-     * {@code query} parameter for each of the returned names, exactly
-     * as an {@code MBeanServer} would. This might result in
-     * {@link #getDynamicMBeanFor getDynamicMBeanFor} being called
-     * several times for each returned name.</p>
-     */
-    public Set<ObjectName> queryNames(ObjectName pattern, QueryExp query) {
-        try {
-            final Set<ObjectName> res = getMatchingNames(pattern);
-            return filterListOfObjectNames(res, query);
-        } catch (Exception x) {
-            LOG.fine("Unexpected exception raised in queryNames: "+x);
-            LOG.log(Level.FINEST, "Unexpected exception raised in queryNames", x);
-        }
-        // We reach here only when an exception was raised.
-        //
-        return Collections.emptySet();
-    }
-
-    private final static boolean apply(final QueryExp query,
-                  final ObjectName on,
-                  final MBeanServer srv) {
-        boolean res = false;
-        MBeanServer oldServer = QueryEval.getMBeanServer();
-        query.setMBeanServer(srv);
-        try {
-            res = query.apply(on);
-        } catch (Exception e) {
-            LOG.finest("QueryExp.apply threw exception, returning false." +
-                    " Cause: "+e);
-            res = false;
-        } finally {
-           /*
-            * query.setMBeanServer is probably
-            * QueryEval.setMBeanServer so put back the old
-            * value.  Since that method uses a ThreadLocal
-            * variable, this code is only needed for the
-            * unusual case where the user creates a custom
-            * QueryExp that calls a nested query on another
-            * MBeanServer.
-            */
-            query.setMBeanServer(oldServer);
-        }
-        return res;
-    }
-
-    /**
-     * Filters a {@code Set<ObjectName>} according to a pattern and a query.
-     * This might be quite inefficient for virtual name spaces.
-     */
-    Set<ObjectName>
-            filterListOfObjectNames(Set<ObjectName> list,
-                                    QueryExp query) {
-        if (list.isEmpty() || query == null)
-            return list;
-
-        // create a new result set
-        final Set<ObjectName> result = new HashSet<ObjectName>();
-
-        for (ObjectName on : list) {
-            // if on doesn't match query exclude it.
-            if (apply(query, on, this))
-                result.add(on);
-        }
-        return result;
-    }
-
-
-    // Don't use {@inheritDoc}, because we don't want to say that the
-    // MBeanServer replaces a reference to the MBean by its ObjectName.
-    /**
-     * <p>Adds a listener to a registered MBean. A notification emitted by
-     * the MBean will be forwarded to the listener.</p>
-     *
-     * <p>This implementation calls
-     * {@link #getNotificationEmitterFor getNotificationEmitterFor}
-     * and invokes {@code addNotificationListener} on the
-     * {@link NotificationEmitter} it returns.
-     *
-     * @see #getDynamicMBeanFor getDynamicMBeanFor
-     * @see #getNotificationEmitterFor getNotificationEmitterFor
-     */
-    public void addNotificationListener(ObjectName name,
-            NotificationListener listener, NotificationFilter filter,
-            Object handback) throws InstanceNotFoundException {
-        final NotificationEmitter emitter =
-                getNonNullNotificationEmitterFor(name);
-        emitter.addNotificationListener(listener, filter, handback);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This implementation calls
-     * {@link #getNotificationEmitterFor getNotificationEmitterFor}
-     * and invokes {@code removeNotificationListener} on the
-     * {@link NotificationEmitter} it returns.
-     * @see #getDynamicMBeanFor getDynamicMBeanFor
-     * @see #getNotificationEmitterFor getNotificationEmitterFor
-     */
-    public void removeNotificationListener(ObjectName name,
-            NotificationListener listener)
-            throws InstanceNotFoundException, ListenerNotFoundException {
-        final NotificationEmitter emitter =
-                getNonNullNotificationEmitterFor(name);
-        emitter.removeNotificationListener(listener);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This implementation calls
-     * {@link #getNotificationEmitterFor getNotificationEmitterFor}
-     * and invokes {@code removeNotificationListener} on the
-     * {@link NotificationEmitter} it returns.
-     * @see #getDynamicMBeanFor getDynamicMBeanFor
-     * @see #getNotificationEmitterFor getNotificationEmitterFor
-     */
-    public void removeNotificationListener(ObjectName name,
-            NotificationListener listener, NotificationFilter filter,
-            Object handback)
-            throws InstanceNotFoundException, ListenerNotFoundException {
-        NotificationEmitter emitter =
-                getNonNullNotificationEmitterFor(name);
-        emitter.removeNotificationListener(listener);
-    }
-
-
-    /**
-     * <p>Adds a listener to a registered MBean.</p>
-     *
-     * <p>The default implementation of this method first calls
-     * {@link #getDynamicMBeanFor getDynamicMBeanFor(listenerName)}.
-     * If that successfully returns an object, call it {@code
-     * mbean}, then (a) if {@code mbean} is an instance of {@link
-     * NotificationListener} then this method calls {@link
-     * #addNotificationListener(ObjectName, NotificationListener,
-     * NotificationFilter, Object) addNotificationListener(name, mbean, filter,
-     * handback)}, otherwise (b) this method throws an exception as specified
-     * for this case.</p>
-     *
-     * <p>This default implementation is not appropriate for Virtual MBeans,
-     * although that only matters if the object returned by {@code
-     * getDynamicMBeanFor} can be an instance of
-     * {@code NotificationListener}.</p>
-     *
-     * @throws RuntimeOperationsException {@inheritDoc}
-     */
-    public void addNotificationListener(ObjectName name, ObjectName listenerName,
-            NotificationFilter filter, Object handback)
-            throws InstanceNotFoundException {
-        NotificationListener listener = getListenerMBean(listenerName);
-        addNotificationListener(name, listener, filter, handback);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link RuntimeOperationsException} wrapping
-     * {@link UnsupportedOperationException}.</p>
-     *
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    public void removeNotificationListener(ObjectName name,
-            ObjectName listenerName)
-            throws InstanceNotFoundException, ListenerNotFoundException {
-        NotificationListener listener = getListenerMBean(listenerName);
-        removeNotificationListener(name, listener);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link RuntimeOperationsException} wrapping
-     * {@link UnsupportedOperationException}.</p>
-     *
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    public void removeNotificationListener(ObjectName name,
-            ObjectName listenerName, NotificationFilter filter,
-            Object handback)
-            throws InstanceNotFoundException, ListenerNotFoundException {
-        NotificationListener listener = getListenerMBean(listenerName);
-        removeNotificationListener(name, listener, filter, handback);
-    }
-
-    private NotificationListener getListenerMBean(ObjectName listenerName)
-            throws InstanceNotFoundException {
-        Object mbean = getDynamicMBeanFor(listenerName);
-        if (mbean instanceof NotificationListener)
-            return (NotificationListener) mbean;
-        else {
-            throw newIllegalArgumentException(
-                    "MBean is not a NotificationListener: " + listenerName);
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link InstanceNotFoundException} wrapping
-     * {@link UnsupportedOperationException}.</p>
-     *
-     * @return the default implementation of this method never returns.
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    public ClassLoader getClassLoader(ObjectName loaderName)
-            throws InstanceNotFoundException {
-        final UnsupportedOperationException failed =
-                new UnsupportedOperationException("getClassLoader");
-        final InstanceNotFoundException x =
-                new InstanceNotFoundException(String.valueOf(loaderName));
-        x.initCause(failed);
-        throw x;
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method calls
-     * {@link #getDynamicMBeanFor getDynamicMBeanFor(mbeanName)} and applies
-     * the logic just described to the result.</p>
-     */
-    public ClassLoader getClassLoaderFor(ObjectName mbeanName)
-            throws InstanceNotFoundException {
-        final DynamicMBean mbean = nonNullMBeanFor(mbeanName);
-        if (mbean instanceof DynamicWrapperMBean)
-            return ((DynamicWrapperMBean) mbean).getWrappedClassLoader();
-        else
-            return mbean.getClass().getClassLoader();
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>The default implementation of this method returns a
-     * {@link ClassLoaderRepository} containing exactly one loader,
-     * the {@linkplain Thread#getContextClassLoader() context class loader}
-     * for the current thread.
-     * Subclasses can override this method to return a different
-     * {@code ClassLoaderRepository}.</p>
-     */
-    public ClassLoaderRepository getClassLoaderRepository() {
-        // We return a new ClassLoaderRepository each time this
-        // method is called. This is by design, because the
-        // SingletonClassLoaderRepository is a very small object and
-        // getClassLoaderRepository() will not be called very often
-        // (the connector server calls it once) - in the context of
-        // MBeanServerSupport there's a very good chance that this method will
-        // *never* be called.
-        ClassLoader ccl = Thread.currentThread().getContextClassLoader();
-        return Util.getSingleClassLoaderRepository(ccl);
-    }
-
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link RuntimeOperationsException} wrapping
-     * {@link UnsupportedOperationException}.</p>
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    public ObjectInstance registerMBean(Object object, ObjectName name)
-            throws InstanceAlreadyExistsException, MBeanRegistrationException,
-            NotCompliantMBeanException {
-        throw newUnsupportedException("registerMBean");
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link RuntimeOperationsException} wrapping
-     * {@link UnsupportedOperationException}.
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    public void unregisterMBean(ObjectName name)
-            throws InstanceNotFoundException, MBeanRegistrationException {
-        throw newUnsupportedException("unregisterMBean");
-    }
-
-    /**
-     * Calls {@link #createMBean(String, ObjectName,
-     *           ObjectName, Object[], String[], boolean)
-     * createMBean(className, name, null, params, signature, true)};
-     */
-    public final ObjectInstance createMBean(String className, ObjectName name,
-            Object[] params, String[] signature)
-            throws ReflectionException, InstanceAlreadyExistsException,
-            MBeanRegistrationException, MBeanException,
-            NotCompliantMBeanException {
-        try {
-            return safeCreateMBean(className, name, null, params, signature, true);
-        } catch (InstanceNotFoundException ex) {
-            // should not happen!
-            throw new MBeanException(ex, "Unexpected exception: " + ex);
-        }
-    }
-
-    /**
-     * Calls {@link #createMBean(String, ObjectName,
-     *           ObjectName, Object[], String[], boolean)
-     * createMBean(className,name, loaderName, params, signature, false)};
-     */
-    public final ObjectInstance createMBean(String className, ObjectName name,
-            ObjectName loaderName, Object[] params, String[] signature)
-            throws ReflectionException, InstanceAlreadyExistsException,
-            MBeanRegistrationException, MBeanException,
-            NotCompliantMBeanException, InstanceNotFoundException {
-        return safeCreateMBean(className, name, loaderName, params, signature, false);
-    }
-
-    /**
-     * Calls {@link #createMBean(String, ObjectName,
-     *           ObjectName, Object[], String[], boolean)
-     * createMBean(className, name, null, null, null, true)};
-     */
-    public final ObjectInstance createMBean(String className, ObjectName name)
-        throws ReflectionException, InstanceAlreadyExistsException,
-            MBeanRegistrationException, MBeanException,
-            NotCompliantMBeanException {
-        try {
-            return safeCreateMBean(className, name, null, null, null, true);
-        } catch (InstanceNotFoundException ex) {
-            // should not happen!
-            throw new MBeanException(ex, "Unexpected exception: " + ex);
-        }
-    }
-
-    /**
-     * Calls {@link #createMBean(String, ObjectName,
-     *           ObjectName, Object[], String[], boolean)
-     * createMBean(className, name, loaderName, null, null, false)};
-     */
-    public final ObjectInstance createMBean(String className, ObjectName name,
-            ObjectName loaderName)
-            throws ReflectionException, InstanceAlreadyExistsException,
-            MBeanRegistrationException, MBeanException,
-            NotCompliantMBeanException, InstanceNotFoundException {
-        return safeCreateMBean(className, name, loaderName, null, null, false);
-    }
-
-    // make sure all exceptions are correctly wrapped in a JMXException
-    private ObjectInstance safeCreateMBean(String className,
-            ObjectName name, ObjectName loaderName, Object[] params,
-            String[] signature, boolean useRepository)
-            throws ReflectionException, InstanceAlreadyExistsException,
-            MBeanRegistrationException, MBeanException,
-            NotCompliantMBeanException, InstanceNotFoundException {
-        try {
-            return createMBean(className, name, loaderName, params,
-                               signature, useRepository);
-        } catch (ReflectionException x) { throw x;
-        } catch (InstanceAlreadyExistsException x) { throw x;
-        } catch (MBeanRegistrationException x) { throw x;
-        } catch (MBeanException x) { throw x;
-        } catch (NotCompliantMBeanException x) { throw x;
-        } catch (InstanceNotFoundException x) { throw x;
-        } catch (SecurityException x) { throw x;
-        } catch (JMRuntimeException x) { throw x;
-        } catch (RuntimeException x) {
-            throw new RuntimeOperationsException(x, x.toString());
-        } catch (Exception x) {
-            throw new MBeanException(x, x.toString());
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link RuntimeOperationsException} wrapping
-     * {@link UnsupportedOperationException}.</p>
-     *
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    public Object instantiate(String className)
-            throws ReflectionException, MBeanException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link RuntimeOperationsException} wrapping
-     * {@link UnsupportedOperationException}.</p>
-     *
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    public Object instantiate(String className, ObjectName loaderName)
-            throws ReflectionException, MBeanException,
-            InstanceNotFoundException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link RuntimeOperationsException} wrapping
-     * {@link UnsupportedOperationException}.</p>
-     *
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    public Object instantiate(String className, Object[] params,
-            String[] signature) throws ReflectionException, MBeanException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link RuntimeOperationsException} wrapping
-     * {@link UnsupportedOperationException}.</p>
-     *
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    public Object instantiate(String className, ObjectName loaderName,
-            Object[] params, String[] signature)
-            throws ReflectionException, MBeanException,
-            InstanceNotFoundException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link RuntimeOperationsException} wrapping
-     * {@link UnsupportedOperationException}.</p>
-     *
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    @Deprecated
-    public ObjectInputStream deserialize(ObjectName name, byte[] data)
-            throws InstanceNotFoundException, OperationsException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link RuntimeOperationsException} wrapping
-     * {@link UnsupportedOperationException}.</p>
-     *
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    @Deprecated
-    public ObjectInputStream deserialize(String className, byte[] data)
-            throws OperationsException, ReflectionException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * <p>This operation is not supported in this base class implementation.
-     * The default implementation of this method always throws
-     * {@link RuntimeOperationsException} wrapping
-     * {@link UnsupportedOperationException}.</p>
-     *
-     * @throws javax.management.RuntimeOperationsException wrapping
-     *        {@link UnsupportedOperationException}
-     */
-    @Deprecated
-    public ObjectInputStream deserialize(String className,
-            ObjectName loaderName, byte[] data)
-            throws InstanceNotFoundException, OperationsException,
-            ReflectionException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-
-    // Calls getDynamicMBeanFor, and throws an InstanceNotFoundException
-    // if the returned mbean is null.
-    // The DynamicMBean returned by this method is thus guaranteed to be
-    // non null.
-    //
-    private DynamicMBean nonNullMBeanFor(ObjectName name)
-            throws InstanceNotFoundException {
-        if (name == null)
-            throw newIllegalArgumentException("Null ObjectName");
-        if (name.getDomain().equals("")) {
-            String defaultDomain = getDefaultDomain();
-            try {
-                // XXX change to ObjectName.switchDomain
-                // current code DOES NOT PRESERVE the order of keys
-                name = new ObjectName(defaultDomain, name.getKeyPropertyList());
-            } catch (Exception e) {
-                throw newIllegalArgumentException(
-                        "Illegal default domain: " + defaultDomain);
-            }
-        }
-        final DynamicMBean mbean = getDynamicMBeanFor(name);
-        if (mbean!=null) return mbean;
-        throw new InstanceNotFoundException(String.valueOf(name));
-    }
-
-    static RuntimeException newUnsupportedException(String operation) {
-        return new RuntimeOperationsException(
-            new UnsupportedOperationException(
-                operation+": Not supported in this namespace"));
-    }
-
-    static RuntimeException newIllegalArgumentException(String msg) {
-        return new RuntimeOperationsException(
-                new IllegalArgumentException(msg));
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/jmx/interceptor/NamespaceDispatchInterceptor.java	Wed Jul 05 16:41:34 2017 +0200
@@ -0,0 +1,236 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.jmx.interceptor;
+
+import com.sun.jmx.defaults.JmxProperties;
+import com.sun.jmx.mbeanserver.MBeanInstantiator;
+import com.sun.jmx.mbeanserver.Repository;
+import com.sun.jmx.mbeanserver.Util;
+import com.sun.jmx.namespace.NamespaceInterceptor;
+
+import java.util.Queue;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerDelegate;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.namespace.JMXDomain;
+import javax.management.namespace.JMXNamespace;
+import static javax.management.namespace.JMXNamespaces.NAMESPACE_SEPARATOR;
+
+/**
+ * A dispatcher that dispatches to NamespaceInterceptors.
+ * <p><b>
+ * This API is a Sun internal API and is subject to changes without notice.
+ * </b></p>
+ * @since 1.7
+ */
+public class NamespaceDispatchInterceptor
+        extends DispatchInterceptor<NamespaceInterceptor, JMXNamespace> {
+
+    /**
+     * A logger for this class.
+     **/
+    private static final Logger LOG = JmxProperties.NAMESPACE_LOGGER;
+
+    private static final int NAMESPACE_SEPARATOR_LENGTH =
+            NAMESPACE_SEPARATOR.length();
+
+    private final DomainDispatchInterceptor localNamespace;
+    private final String           serverName;
+
+    /**
+     * Creates a NamespaceDispatchInterceptor with the specified
+     * repository instance.
+     * <p>Do not forget to call <code>initialize(outer,delegate)</code>
+     * before using this object.
+     *
+     * @param outer A pointer to the MBeanServer object that must be
+     *        passed to the MBeans when invoking their
+     *        {@link javax.management.MBeanRegistration} interface.
+     * @param delegate A pointer to the MBeanServerDelegate associated
+     *        with the new MBeanServer. The new MBeanServer must register
+     *        this MBean in its MBean repository.
+     * @param instantiator The MBeanInstantiator that will be used to
+     *        instantiate MBeans and take care of class loading issues.
+     * @param repository The repository to use for this MBeanServer
+     */
+    public NamespaceDispatchInterceptor(MBeanServer         outer,
+                               MBeanServerDelegate delegate,
+                               MBeanInstantiator   instantiator,
+                               Repository          repository)  {
+           localNamespace = new DomainDispatchInterceptor(outer,delegate,
+                   instantiator,repository,this);
+           serverName = Util.getMBeanServerSecurityName(delegate);
+    }
+
+    // TODO: Should move that to JMXNamespace? or to ObjectName?
+    /**
+     * Get first name space in ObjectName path. Ignore leading namespace
+     * separators.
+     **/
+    public static String getFirstNamespace(ObjectName name) {
+        if (name == null) return "";
+        final String domain = name.getDomain();
+        if (domain.equals("")) return "";
+
+        int first = 0;
+        int end = domain.indexOf(NAMESPACE_SEPARATOR,first);
+        while (end == first) {
+            first = end+NAMESPACE_SEPARATOR_LENGTH;
+            end = domain.indexOf(NAMESPACE_SEPARATOR,first);
+            if (end == -1) break;
+        }
+
+        if (end == -1) return "";
+
+        final String namespace = domain.substring(first,end);
+
+        return namespace;
+    }
+
+    /**
+     * Called by the DefaultMBeanServerInterceptor, just before adding an
+     * MBean to the repository.
+     *
+     * @param resource the MBean to be registered.
+     * @param logicalName the name of the MBean to be registered.
+     */
+    final void checkLocallyRegistrable(Object resource,
+            ObjectName logicalName) {
+        if (!(resource instanceof JMXNamespace) &&
+                logicalName.getDomain().contains(NAMESPACE_SEPARATOR))
+            throw new IllegalArgumentException(String.valueOf(logicalName)+
+                    ": Invalid ObjectName for an instance of " +
+                    resource.getClass().getName());
+    }
+
+    final boolean isLocalHandlerNameFor(String namespace,
+            ObjectName handlerName) {
+        return handlerName.getDomain().equals(namespace+NAMESPACE_SEPARATOR) &&
+               JMXNamespace.TYPE_ASSIGNMENT.equals(
+               handlerName.getKeyPropertyListString());
+    }
+
+    @Override
+    final MBeanServer getInterceptorOrNullFor(ObjectName name) {
+        final String namespace = getFirstNamespace(name);
+        if (namespace.equals("") || isLocalHandlerNameFor(namespace,name) ||
+            name.getDomain().equals(namespace+NAMESPACE_SEPARATOR)) {
+            LOG.finer("dispatching to local name space");
+            return localNamespace;
+        }
+        final NamespaceInterceptor ns = getInterceptor(namespace);
+        if (LOG.isLoggable(Level.FINER)) {
+            if (ns != null) {
+                LOG.finer("dispatching to name space: " + namespace);
+            } else {
+                LOG.finer("no handler for: " + namespace);
+            }
+        }
+        return ns;
+    }
+
+    @Override
+    final QueryInterceptor getInterceptorForQuery(ObjectName pattern) {
+        final String namespace = getFirstNamespace(pattern);
+        if (namespace.equals("") || isLocalHandlerNameFor(namespace,pattern) ||
+            pattern.getDomain().equals(namespace+NAMESPACE_SEPARATOR)) {
+            LOG.finer("dispatching to local name space");
+            return new QueryInterceptor(localNamespace);
+        }
+        final NamespaceInterceptor ns = getInterceptor(namespace);
+        if (LOG.isLoggable(Level.FINER)) {
+            if (ns != null) {
+                LOG.finer("dispatching to name space: " + namespace);
+            } else {
+                LOG.finer("no handler for: " + namespace);
+            }
+        }
+        if (ns == null) return null;
+        return new QueryInterceptor(ns);
+    }
+
+    @Override
+    final ObjectName getHandlerNameFor(String key)
+        throws MalformedObjectNameException {
+        return ObjectName.getInstance(key+NAMESPACE_SEPARATOR,
+                    "type", JMXNamespace.TYPE);
+    }
+
+    @Override
+    final public String getHandlerKey(ObjectName name) {
+        return getFirstNamespace(name);
+    }
+
+    @Override
+    final NamespaceInterceptor createInterceptorFor(String key,
+            ObjectName name, JMXNamespace handler,
+            Queue<Runnable> postRegisterQueue) {
+        final NamespaceInterceptor ns =
+                new NamespaceInterceptor(serverName,handler,key);
+        if (LOG.isLoggable(Level.FINER)) {
+            LOG.finer("NamespaceInterceptor created: "+ns);
+        }
+        return ns;
+    }
+
+    @Override
+    final DomainDispatchInterceptor getNextInterceptor() {
+        return localNamespace;
+    }
+
+    /**
+     * Returns the list of domains in which any MBean is currently
+     * registered.
+     */
+    @Override
+    public String[] getDomains() {
+        return localNamespace.getDomains();
+    }
+
+    @Override
+    public void addNamespace(ObjectName name, JMXNamespace handler,
+            Queue<Runnable> postRegisterQueue) {
+        if (handler instanceof JMXDomain)
+            localNamespace.addNamespace(name,
+                    (JMXDomain)handler,postRegisterQueue);
+        else super.addNamespace(name,handler,postRegisterQueue);
+    }
+
+    @Override
+    public void removeNamespace(ObjectName name, JMXNamespace handler,
+            Queue<Runnable> postDeregisterQueue) {
+        if (handler instanceof JMXDomain)
+            localNamespace.removeNamespace(name,(JMXDomain)handler,
+                    postDeregisterQueue);
+        else super.removeNamespace(name,handler,postDeregisterQueue);
+    }
+
+
+}
--- a/jdk/src/share/classes/com/sun/jmx/interceptor/SingleMBeanForwarder.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/interceptor/SingleMBeanForwarder.java	Wed Jul 05 16:41:34 2017 +0200
@@ -51,6 +51,8 @@
 import javax.management.ObjectName;
 import javax.management.QueryExp;
 import javax.management.ReflectionException;
+import javax.management.namespace.JMXNamespaces;
+import javax.management.namespace.MBeanServerSupport;
 import javax.management.remote.IdentityMBeanServerForwarder;
 
 public class SingleMBeanForwarder extends IdentityMBeanServerForwarder {
@@ -285,14 +287,14 @@
         if (!pattern.apply(mbeanName))
             return false;
 
-//        final String dompat = pattern.getDomain();
-//        if (!dompat.contains(JMXNamespaces.NAMESPACE_SEPARATOR))
-//            return true; // We already checked that patterns apply.
-//
-//        if (mbeanName.getDomain().endsWith(JMXNamespaces.NAMESPACE_SEPARATOR)) {
-//            // only matches if pattern ends with //
-//            return dompat.endsWith(JMXNamespaces.NAMESPACE_SEPARATOR);
-//        }
+        final String dompat = pattern.getDomain();
+        if (!dompat.contains(JMXNamespaces.NAMESPACE_SEPARATOR))
+            return true; // We already checked that patterns apply.
+
+        if (mbeanName.getDomain().endsWith(JMXNamespaces.NAMESPACE_SEPARATOR)) {
+            // only matches if pattern ends with //
+            return dompat.endsWith(JMXNamespaces.NAMESPACE_SEPARATOR);
+        }
 
         // should not come here, unless mbeanName contains a // in the
         // middle of its domain, which would be weird.
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/JmxMBeanServer.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/JmxMBeanServer.java	Wed Jul 05 16:41:34 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,44 +25,42 @@
 
 package com.sun.jmx.mbeanserver;
 
-import java.util.Iterator;
-import java.util.logging.Level;
-import java.util.Set;
+import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER;
+import com.sun.jmx.interceptor.NamespaceDispatchInterceptor;
+
 import java.io.ObjectInputStream;
 import java.security.AccessController;
 import java.security.Permission;
 import java.security.PrivilegedExceptionAction;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.logging.Level;
 
-// RI import
-import javax.management.MBeanPermission;
-import javax.management.AttributeNotFoundException;
-import javax.management.MBeanException;
-import javax.management.ReflectionException;
-import javax.management.MBeanInfo;
-import javax.management.QueryExp;
-import javax.management.NotificationListener;
-import javax.management.NotificationFilter;
-import javax.management.ListenerNotFoundException;
-import javax.management.IntrospectionException;
-import javax.management.OperationsException;
-import javax.management.InstanceNotFoundException;
-import javax.management.NotCompliantMBeanException;
-import javax.management.MBeanRegistrationException;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.ObjectName;
-import javax.management.ObjectInstance;
 import javax.management.Attribute;
 import javax.management.AttributeList;
-import javax.management.RuntimeOperationsException;
+import javax.management.AttributeNotFoundException;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.IntrospectionException;
+import javax.management.InvalidAttributeValueException;
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanPermission;
+import javax.management.MBeanRegistrationException;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerDelegate;
+import javax.management.NotCompliantMBeanException;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+import javax.management.OperationsException;
+import javax.management.QueryExp;
+import javax.management.ReflectionException;
+import javax.management.RuntimeOperationsException;
 import javax.management.loading.ClassLoaderRepository;
 
-import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER;
-import com.sun.jmx.interceptor.DefaultMBeanServerInterceptor;
-import com.sun.jmx.interceptor.MBeanServerInterceptor;
-
 /**
  * This is the base class for MBean manipulation on the agent side. It
  * contains the methods necessary for the creation, registration, and
@@ -102,15 +100,14 @@
     /** true if interceptors are enabled **/
     private final boolean interceptorsEnabled;
 
-    /** Revisit: transient ??? **/
-    private final transient MBeanServer outerShell;
+    private final MBeanServer outerShell;
 
-    /** Revisit: transient ??? **/
-    private transient MBeanServerInterceptor mbsInterceptor = null;
+    private volatile MBeanServer mbsInterceptor = null;
 
-    /** Revisit: transient ??? **/
     /** The MBeanServerDelegate object representing the MBean Server */
-    private final transient MBeanServerDelegate mBeanServerDelegateObject;
+    private final MBeanServerDelegate mBeanServerDelegateObject;
+
+    private final String mbeanServerName;
 
     /**
      * <b>Package:</b> Creates an MBeanServer with the
@@ -243,9 +240,10 @@
 
         final Repository repository = new Repository(domain,fairLock);
         this.mbsInterceptor =
-            new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
+            new NamespaceDispatchInterceptor(outer, delegate, instantiator,
                                               repository);
         this.interceptorsEnabled = interceptors;
+        this.mbeanServerName = Util.getMBeanServerSecurityName(delegate);
         initialize();
     }
 
@@ -941,7 +939,8 @@
         throws ReflectionException, MBeanException {
 
         /* Permission check */
-        checkMBeanPermission(className, null, null, "instantiate");
+        checkMBeanPermission(mbeanServerName, className, null, null,
+                "instantiate");
 
         return instantiator.instantiate(className);
     }
@@ -978,7 +977,8 @@
                InstanceNotFoundException {
 
         /* Permission check */
-        checkMBeanPermission(className, null, null, "instantiate");
+        checkMBeanPermission(mbeanServerName, className, null,
+                null, "instantiate");
 
         ClassLoader myLoader = outerShell.getClass().getClassLoader();
         return instantiator.instantiate(className, loaderName, myLoader);
@@ -1016,7 +1016,8 @@
         throws ReflectionException, MBeanException {
 
         /* Permission check */
-        checkMBeanPermission(className, null, null, "instantiate");
+        checkMBeanPermission(mbeanServerName, className, null, null,
+                "instantiate");
 
         ClassLoader myLoader = outerShell.getClass().getClassLoader();
         return instantiator.instantiate(className, params, signature,
@@ -1059,7 +1060,8 @@
                InstanceNotFoundException {
 
         /* Permission check */
-        checkMBeanPermission(className, null, null, "instantiate");
+        checkMBeanPermission(mbeanServerName, className, null,
+                null, "instantiate");
 
         ClassLoader myLoader = outerShell.getClass().getClassLoader();
         return instantiator.instantiate(className,loaderName,params,signature,
@@ -1236,7 +1238,7 @@
                         "Unexpected exception occurred", e);
             }
             throw new
-                IllegalStateException("Can't register delegate.");
+                IllegalStateException("Can't register delegate.",e);
         }
 
 
@@ -1278,7 +1280,7 @@
      *            are not enabled on this object.
      * @see #interceptorsEnabled
      **/
-    public synchronized MBeanServerInterceptor getMBeanServerInterceptor() {
+    public synchronized MBeanServer getMBeanServerInterceptor() {
         if (interceptorsEnabled) return mbsInterceptor;
         else throw new UnsupportedOperationException(
                        "MBeanServerInterceptors are disabled.");
@@ -1292,7 +1294,7 @@
      * @see #interceptorsEnabled
      **/
     public synchronized void
-        setMBeanServerInterceptor(MBeanServerInterceptor interceptor) {
+        setMBeanServerInterceptor(MBeanServer interceptor) {
         if (!interceptorsEnabled) throw new UnsupportedOperationException(
                        "MBeanServerInterceptors are disabled.");
         if (interceptor == null) throw new
@@ -1330,7 +1332,8 @@
      **/
     public ClassLoaderRepository getClassLoaderRepository() {
         /* Permission check */
-        checkMBeanPermission(null, null, null, "getClassLoaderRepository");
+        checkMBeanPermission(mbeanServerName, null, null,
+                null, "getClassLoaderRepository");
         return secureClr;
     }
 
@@ -1484,14 +1487,16 @@
     // SECURITY CHECKS
     //----------------
 
-    private static void checkMBeanPermission(String classname,
+    private static void checkMBeanPermission(String serverName,
+                                             String classname,
                                              String member,
                                              ObjectName objectName,
                                              String actions)
         throws SecurityException {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            Permission perm = new MBeanPermission(classname,
+            Permission perm = new MBeanPermission(serverName,
+                                                  classname,
                                                   member,
                                                   objectName,
                                                   actions);
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanLookup.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanLookup.java	Wed Jul 05 16:41:34 2017 +0200
@@ -224,7 +224,7 @@
         throws InvalidObjectException {
             String domain = prefix + name.getDomain();
             try {
-                name = switchDomain(domain, name);
+                name = name.withDomain(domain);
             } catch (MalformedObjectNameException e) {
                 throw EnvHelp.initCause(
                         new InvalidObjectException(e.getMessage()), e);
@@ -242,7 +242,7 @@
                         "Proxy's name does not start with " + prefix + ": " + name);
             }
             try {
-                name = switchDomain(domain.substring(prefix.length()), name);
+                name = name.withDomain(domain.substring(prefix.length()));
             } catch (MalformedObjectNameException e) {
                 throw EnvHelp.initCause(new OpenDataException(e.getMessage()), e);
             }
@@ -269,14 +269,6 @@
         currentLookup.set(lookup);
     }
 
-    // Method temporarily added until we have ObjectName.switchDomain in the
-    // public API.  Note that this method DOES NOT PRESERVE the order of
-    // keys in the ObjectName so it must not be used in the final release.
-    static ObjectName switchDomain(String domain, ObjectName name)
-            throws MalformedObjectNameException {
-        return new ObjectName(domain, name.getKeyPropertyList());
-    }
-
     private static final ThreadLocal<MXBeanLookup> currentLookup =
             new ThreadLocal<MXBeanLookup>();
 
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Repository.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Repository.java	Wed Jul 05 16:41:34 2017 +0200
@@ -45,7 +45,6 @@
 import javax.management.RuntimeOperationsException;
 
 /**
- * The RepositorySupport implements the Repository interface.
  * This repository does not support persistency.
  *
  * @since 1.5
@@ -197,9 +196,9 @@
                     if (isPropertyValuePattern &&
                         pattern.isPropertyValuePattern(keys[i])) {
                         // wildmatch key property values
-                        final char[] val_pattern = values[i].toCharArray();
-                        final char[] val_string  = v.toCharArray();
-                        if (wildmatch(val_string,val_pattern))
+                        // values[i] is the pattern;
+                        // v is the string
+                        if (Util.wildmatch(v,values[i]))
                             continue;
                         else
                             return false;
@@ -236,86 +235,6 @@
         }
     }
 
-    /** Match a string against a shell-style pattern.  The only pattern
-        characters recognised are <code>?</code>, standing for any one
-        character, and <code>*</code>, standing for any string of
-        characters, including the empty string.
-
-        @param str the string to match, as a character array.
-        @param pat the pattern to match the string against, as a
-        character array.
-
-        @return true if and only if the string matches the pattern.
-    */
-    /* The algorithm is a classical one.  We advance pointers in
-       parallel through str and pat.  If we encounter a star in pat,
-       we remember its position and continue advancing.  If at any
-       stage we get a mismatch between str and pat, we look to see if
-       there is a remembered star.  If not, we fail.  If so, we
-       retreat pat to just past that star and str to the position
-       after the last one we tried, and we let the match advance
-       again.
-
-       Even though there is only one remembered star position, the
-       algorithm works when there are several stars in the pattern.
-       When we encounter the second star, we forget the first one.
-       This is OK, because if we get to the second star in A*B*C
-       (where A etc are arbitrary strings), we have already seen AXB.
-       We're therefore setting up a match of *C against the remainder
-       of the string, which will match if that remainder looks like
-       YC, so the whole string looks like AXBYC.
-    */
-    public static boolean wildmatch(char[] str, char[] pat) {
-        int stri;     // index in str
-        int pati;     // index in pat
-        int starstri; // index for backtrack if "*" attempt fails
-        int starpati; // index for backtrack if "*" attempt fails, +1
-        final int strlen = str.length;
-        final int patlen = pat.length;
-
-        stri = pati = 0;
-        starstri = starpati = -1;
-
-        /* On each pass through this loop, we either advance pati,
-           or we backtrack pati and advance starstri.  Since starstri
-           is only ever assigned from pati, the loop must terminate.  */
-        while (true) {
-            if (pati < patlen) {
-                final char patc = pat[pati];
-                switch (patc) {
-                case '?':
-                    if (stri == strlen)
-                        break;
-                    stri++;
-                    pati++;
-                    continue;
-                case '*':
-                    pati++;
-                    starpati = pati;
-                    starstri = stri;
-                    continue;
-                default:
-                    if (stri < strlen && str[stri] == patc) {
-                        stri++;
-                        pati++;
-                        continue;
-                    }
-                    break;
-                }
-            } else if (stri == strlen)
-                return true;
-
-            // Mismatched, can we backtrack to a "*"?
-            if (starpati < 0 || starstri == strlen)
-                return false;
-
-            // Retry the match one position later in str
-            pati = starpati;
-            starstri++;
-            stri = starstri;
-        }
-    }
-
     private void addNewDomMoi(final DynamicMBean object,
                               final String dom,
                               final ObjectName name,
@@ -370,7 +289,7 @@
         if (name.isPattern()) return null;
 
         // Extract the domain name.
-        String dom= name.getDomain().intern();
+        String dom = name.getDomain().intern();
 
         // Default domain case
         if (dom.length() == 0) {
@@ -480,7 +399,7 @@
             name = Util.newObjectName(domain + name.toString());
 
         // Do we have default domain ?
-        if (dom == domain) {
+        if (dom == domain) {  // ES: OK (dom & domain are interned)
             to_default_domain = true;
             dom = domain;
         } else {
@@ -652,10 +571,9 @@
             }
 
             // Pattern matching in the domain name (*, ?)
-            char[] dom2Match = name.getDomain().toCharArray();
+            final String dom2Match = name.getDomain();
             for (String dom : domainTb.keySet()) {
-                char[] theDom = dom.toCharArray();
-                if (wildmatch(theDom, dom2Match)) {
+                if (Util.wildpathmatch(dom, dom2Match)) {
                     final Map<String,NamedObject> moiTb = domainTb.get(dom);
                     if (allNames)
                         result.addAll(moiTb.values());
@@ -726,7 +644,7 @@
                 // need to reinstantiate a hashtable because of possible
                 // big buckets array size inside table, never cleared,
                 // thus the new !
-                if (dom == domain)
+                if (dom == domain) // ES: OK dom and domain are interned.
                     domainTb.put(domain, new HashMap<String,NamedObject>());
             }
 
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/SunJmxMBeanServer.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/SunJmxMBeanServer.java	Wed Jul 05 16:41:34 2017 +0200
@@ -28,17 +28,16 @@
 import javax.management.MBeanServer;
 import javax.management.MBeanServerDelegate;
 
-import com.sun.jmx.interceptor.MBeanServerInterceptor;
 
 /**
- * Extends the MBeanServer and MBeanServerInterceptor interface to
+ * Extends the MBeanServer interface to
  * provide methods for getting the MetaData and MBeanServerInstantiator
  * objects associated with an MBeanServer.
  *
  * @since 1.5
  */
 public interface SunJmxMBeanServer
-    extends MBeanServerInterceptor, MBeanServer {
+    extends MBeanServer {
 
     /**
      * Return the MBeanInstantiator associated to this MBeanServer.
@@ -68,7 +67,7 @@
      *            are not enabled on this object.
      * @see #interceptorsEnabled
      **/
-    public MBeanServerInterceptor getMBeanServerInterceptor();
+    public MBeanServer getMBeanServerInterceptor();
 
     /**
      * Set the MBeanServerInterceptor.
@@ -77,7 +76,7 @@
      *            are not enabled on this object.
      * @see #interceptorsEnabled
      **/
-    public void setMBeanServerInterceptor(MBeanServerInterceptor interceptor);
+    public void setMBeanServerInterceptor(MBeanServer interceptor);
 
     /**
      * <p>Return the MBeanServerDelegate representing the MBeanServer.
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Util.java	Fri Sep 12 14:35:51 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Util.java	Wed Jul 05 16:41:34 2017 +0200
@@ -25,6 +25,8 @@
 
 package com.sun.jmx.mbeanserver;
 
+import com.sun.jmx.defaults.JmxProperties;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -42,11 +44,22 @@
 import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.WeakHashMap;
+import java.util.logging.Level;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerDelegate;
+import javax.management.MBeanServerFactory;
 import javax.management.MalformedObjectNameException;
+import javax.management.ObjectInstance;
 import javax.management.ObjectName;
 import javax.management.loading.ClassLoaderRepository;
+import static javax.management.namespace.JMXNamespaces.NAMESPACE_SEPARATOR;
 
 public class Util {
+    private final static int NAMESPACE_SEPARATOR_LENGTH =
+            NAMESPACE_SEPARATOR.length();
+    public final static String ILLEGAL_MBEANSERVER_NAME_CHARS=";:*?";
+
+
     static <K, V> Map<K, V> newMap() {
         return new HashMap<K, V>();
     }</