Merge
authorlana
Sat, 21 Jan 2017 03:53:21 +0000
changeset 43239 f5fe514d00ce
parent 43168 8c70d170e62c (current diff)
parent 43238 60b2aa915d98 (diff)
child 43240 5840f84ea2e3
Merge
jdk/test/ProblemList.txt
jdk/test/java/lang/SecurityManager/RestrictedPackages.java
--- a/jdk/make/CompileModuleTools.gmk	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/make/CompileModuleTools.gmk	Sat Jan 21 03:53:21 2017 +0000
@@ -37,6 +37,5 @@
                 build/tools/jigsaw, \
     BIN := $(TOOLS_CLASSES_DIR), \
     ADD_JAVAC_FLAGS := \
-        --add-exports jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED \
         --add-exports java.base/jdk.internal.module=ALL-UNNAMED \
 ))
--- a/jdk/make/ModuleTools.gmk	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/make/ModuleTools.gmk	Sat Jan 21 03:53:21 2017 +0000
@@ -39,7 +39,6 @@
     build.tools.jigsaw.GenGraphs
 
 TOOL_MODULESUMMARY := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
-    --add-exports jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED \
     build.tools.jigsaw.ModuleSummary
 
 TOOL_ADD_PACKAGES_ATTRIBUTE := $(BUILD_JAVA) $(JAVA_FLAGS_SMALL) \
--- a/jdk/src/java.base/share/classes/com/sun/net/ssl/HttpsURLConnection.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/net/ssl/HttpsURLConnection.java	Sat Jan 21 03:53:21 2017 +0000
@@ -69,6 +69,10 @@
     /**
      * Returns the server's X.509 certificate chain, or null if
      * the server did not authenticate.
+     * <P>
+     * Note: The returned value may not be a valid certificate chain
+     * and should not be relied on for trust decisions.
+     *
      * @return the server certificate chain
      */
     public abstract Certificate[] getServerCertificates()
--- a/jdk/src/java.base/share/classes/java/lang/Class.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/Class.java	Sat Jan 21 03:53:21 2017 +0000
@@ -508,8 +508,9 @@
     public T newInstance()
         throws InstantiationException, IllegalAccessException
     {
-        if (System.getSecurityManager() != null) {
-            checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), false);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), false);
         }
 
         // NOTE: the following code may not be strictly correct under
@@ -1223,38 +1224,27 @@
 
             // Perform access check
             final Class<?> enclosingCandidate = enclosingInfo.getEnclosingClass();
-            enclosingCandidate.checkMemberAccess(Member.DECLARED,
-                                                 Reflection.getCallerClass(), true);
-            // Client is ok to access declared methods but j.l.Class might not be.
-            Method[] candidates = AccessController.doPrivileged(
-                    new PrivilegedAction<>() {
-                        @Override
-                        public Method[] run() {
-                            return enclosingCandidate.getDeclaredMethods();
-                        }
-                    });
+            SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                enclosingCandidate.checkMemberAccess(sm, Member.DECLARED,
+                                                     Reflection.getCallerClass(), true);
+            }
+            Method[] candidates = enclosingCandidate.privateGetDeclaredMethods(false);
+
             /*
              * Loop over all declared methods; match method name,
              * number of and type of parameters, *and* return
              * type.  Matching return type is also necessary
              * because of covariant returns, etc.
              */
-            for(Method m: candidates) {
-                if (m.getName().equals(enclosingInfo.getName()) ) {
-                    Class<?>[] candidateParamClasses = m.getParameterTypes();
-                    if (candidateParamClasses.length == parameterClasses.length) {
-                        boolean matches = true;
-                        for(int i = 0; i < candidateParamClasses.length; i++) {
-                            if (!candidateParamClasses[i].equals(parameterClasses[i])) {
-                                matches = false;
-                                break;
-                            }
-                        }
-
-                        if (matches) { // finally, check return type
-                            if (m.getReturnType().equals(returnType) )
-                                return m;
-                        }
+            ReflectionFactory fact = getReflectionFactory();
+            for (Method m : candidates) {
+                if (m.getName().equals(enclosingInfo.getName()) &&
+                    arrayContentsEq(parameterClasses,
+                                    fact.getExecutableSharedParameterTypes(m))) {
+                    // finally, check return type
+                    if (m.getReturnType().equals(returnType)) {
+                        return fact.copyMethod(m);
                     }
                 }
             }
@@ -1390,33 +1380,23 @@
 
             // Perform access check
             final Class<?> enclosingCandidate = enclosingInfo.getEnclosingClass();
-            enclosingCandidate.checkMemberAccess(Member.DECLARED,
-                                                 Reflection.getCallerClass(), true);
-            // Client is ok to access declared methods but j.l.Class might not be.
-            Constructor<?>[] candidates = AccessController.doPrivileged(
-                    new PrivilegedAction<>() {
-                        @Override
-                        public Constructor<?>[] run() {
-                            return enclosingCandidate.getDeclaredConstructors();
-                        }
-                    });
+            SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                enclosingCandidate.checkMemberAccess(sm, Member.DECLARED,
+                                                     Reflection.getCallerClass(), true);
+            }
+
+            Constructor<?>[] candidates = enclosingCandidate
+                    .privateGetDeclaredConstructors(false);
             /*
              * Loop over all declared constructors; match number
              * of and type of parameters.
              */
-            for(Constructor<?> c: candidates) {
-                Class<?>[] candidateParamClasses = c.getParameterTypes();
-                if (candidateParamClasses.length == parameterClasses.length) {
-                    boolean matches = true;
-                    for(int i = 0; i < candidateParamClasses.length; i++) {
-                        if (!candidateParamClasses[i].equals(parameterClasses[i])) {
-                            matches = false;
-                            break;
-                        }
-                    }
-
-                    if (matches)
-                        return c;
+            ReflectionFactory fact = getReflectionFactory();
+            for (Constructor<?> c : candidates) {
+                if (arrayContentsEq(parameterClasses,
+                                    fact.getExecutableSharedParameterTypes(c))) {
+                    return fact.copyConstructor(c);
                 }
             }
 
@@ -1446,9 +1426,13 @@
     public Class<?> getDeclaringClass() throws SecurityException {
         final Class<?> candidate = getDeclaringClass0();
 
-        if (candidate != null)
-            candidate.checkPackageAccess(
+        if (candidate != null) {
+            SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                candidate.checkPackageAccess(sm,
                     ClassLoader.getClassLoader(Reflection.getCallerClass()), true);
+            }
+        }
         return candidate;
     }
 
@@ -1496,9 +1480,13 @@
                 enclosingCandidate = enclosingClass;
         }
 
-        if (enclosingCandidate != null)
-            enclosingCandidate.checkPackageAccess(
+        if (enclosingCandidate != null) {
+            SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                enclosingCandidate.checkPackageAccess(sm,
                     ClassLoader.getClassLoader(Reflection.getCallerClass()), true);
+            }
+        }
         return enclosingCandidate;
     }
 
@@ -1688,7 +1676,10 @@
      */
     @CallerSensitive
     public Class<?>[] getClasses() {
-        checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), false);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), false);
+        }
 
         // Privileged so this implementation can look at DECLARED classes,
         // something the caller might not have privilege to do.  The code here
@@ -1754,7 +1745,10 @@
      */
     @CallerSensitive
     public Field[] getFields() throws SecurityException {
-        checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true);
+        }
         return copyFields(privateGetPublicFields(null));
     }
 
@@ -1841,7 +1835,10 @@
      */
     @CallerSensitive
     public Method[] getMethods() throws SecurityException {
-        checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true);
+        }
         return copyMethods(privateGetPublicMethods());
     }
 
@@ -1877,7 +1874,10 @@
      */
     @CallerSensitive
     public Constructor<?>[] getConstructors() throws SecurityException {
-        checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true);
+        }
         return copyConstructors(privateGetDeclaredConstructors(true));
     }
 
@@ -1928,7 +1928,10 @@
     public Field getField(String name)
         throws NoSuchFieldException, SecurityException {
         Objects.requireNonNull(name);
-        checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true);
+        }
         Field field = getField0(name);
         if (field == null) {
             throw new NoSuchFieldException(name);
@@ -2034,10 +2037,13 @@
     public Method getMethod(String name, Class<?>... parameterTypes)
         throws NoSuchMethodException, SecurityException {
         Objects.requireNonNull(name);
-        checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true);
+        }
         Method method = getMethod0(name, parameterTypes);
         if (method == null) {
-            throw new NoSuchMethodException(getName() + "." + name + argumentTypesToString(parameterTypes));
+            throw new NoSuchMethodException(methodToString(name, parameterTypes));
         }
         return getReflectionFactory().copyMethod(method);
     }
@@ -2092,8 +2098,12 @@
      */
     @CallerSensitive
     public Constructor<T> getConstructor(Class<?>... parameterTypes)
-        throws NoSuchMethodException, SecurityException {
-        checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true);
+        throws NoSuchMethodException, SecurityException
+    {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true);
+        }
         return getReflectionFactory().copyConstructor(
             getConstructor0(parameterTypes, Member.PUBLIC));
     }
@@ -2136,7 +2146,10 @@
      */
     @CallerSensitive
     public Class<?>[] getDeclaredClasses() throws SecurityException {
-        checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), false);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), false);
+        }
         return getDeclaredClasses0();
     }
 
@@ -2185,7 +2198,10 @@
      */
     @CallerSensitive
     public Field[] getDeclaredFields() throws SecurityException {
-        checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true);
+        }
         return copyFields(privateGetDeclaredFields(false));
     }
 
@@ -2244,7 +2260,10 @@
      */
     @CallerSensitive
     public Method[] getDeclaredMethods() throws SecurityException {
-        checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true);
+        }
         return copyMethods(privateGetDeclaredMethods(false));
     }
 
@@ -2289,7 +2308,10 @@
      */
     @CallerSensitive
     public Constructor<?>[] getDeclaredConstructors() throws SecurityException {
-        checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true);
+        }
         return copyConstructors(privateGetDeclaredConstructors(false));
     }
 
@@ -2338,7 +2360,10 @@
     public Field getDeclaredField(String name)
         throws NoSuchFieldException, SecurityException {
         Objects.requireNonNull(name);
-        checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true);
+        }
         Field field = searchFields(privateGetDeclaredFields(false), name);
         if (field == null) {
             throw new NoSuchFieldException(name);
@@ -2399,10 +2424,13 @@
     public Method getDeclaredMethod(String name, Class<?>... parameterTypes)
         throws NoSuchMethodException, SecurityException {
         Objects.requireNonNull(name);
-        checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true);
+        }
         Method method = searchMethods(privateGetDeclaredMethods(false), name, parameterTypes);
         if (method == null) {
-            throw new NoSuchMethodException(getName() + "." + name + argumentTypesToString(parameterTypes));
+            throw new NoSuchMethodException(methodToString(name, parameterTypes));
         }
         return getReflectionFactory().copyMethod(method);
     }
@@ -2448,8 +2476,13 @@
      */
     @CallerSensitive
     public Constructor<T> getDeclaredConstructor(Class<?>... parameterTypes)
-        throws NoSuchMethodException, SecurityException {
-        checkMemberAccess(Member.DECLARED, Reflection.getCallerClass(), true);
+        throws NoSuchMethodException, SecurityException
+    {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true);
+        }
+
         return getReflectionFactory().copyConstructor(
             getConstructor0(parameterTypes, Member.DECLARED));
     }
@@ -2697,51 +2730,49 @@
      *
      * <p> Default policy: allow all clients access with normal Java access
      * control.
+     *
+     * <p> NOTE: should only be called if a SecurityManager is installed
      */
-    private void checkMemberAccess(int which, Class<?> caller, boolean checkProxyInterfaces) {
-        final SecurityManager s = System.getSecurityManager();
-        if (s != null) {
-            /* Default policy allows access to all {@link Member#PUBLIC} members,
-             * as well as access to classes that have the same class loader as the caller.
-             * In all other cases, it requires RuntimePermission("accessDeclaredMembers")
-             * permission.
-             */
-            final ClassLoader ccl = ClassLoader.getClassLoader(caller);
+    private void checkMemberAccess(SecurityManager sm, int which,
+                                   Class<?> caller, boolean checkProxyInterfaces) {
+        /* Default policy allows access to all {@link Member#PUBLIC} members,
+         * as well as access to classes that have the same class loader as the caller.
+         * In all other cases, it requires RuntimePermission("accessDeclaredMembers")
+         * permission.
+         */
+        final ClassLoader ccl = caller.getClassLoader0();
+        if (which != Member.PUBLIC) {
             final ClassLoader cl = getClassLoader0();
-            if (which != Member.PUBLIC) {
-                if (ccl != cl) {
-                    s.checkPermission(SecurityConstants.CHECK_MEMBER_ACCESS_PERMISSION);
-                }
+            if (ccl != cl) {
+                sm.checkPermission(SecurityConstants.CHECK_MEMBER_ACCESS_PERMISSION);
             }
-            this.checkPackageAccess(ccl, checkProxyInterfaces);
         }
+        this.checkPackageAccess(sm, ccl, checkProxyInterfaces);
     }
 
     /*
      * Checks if a client loaded in ClassLoader ccl is allowed to access this
      * class under the current package access policy. If access is denied,
      * throw a SecurityException.
+     *
+     * NOTE: this method should only be called if a SecurityManager is active
      */
-    private void checkPackageAccess(final ClassLoader ccl, boolean checkProxyInterfaces) {
-        final SecurityManager s = System.getSecurityManager();
-        if (s != null) {
-            final ClassLoader cl = getClassLoader0();
-
-            if (ReflectUtil.needsPackageAccessCheck(ccl, cl)) {
-                String name = this.getName();
-                int i = name.lastIndexOf('.');
-                if (i != -1) {
-                    // skip the package access check on a proxy class in default proxy package
-                    String pkg = name.substring(0, i);
-                    if (!Proxy.isProxyClass(this) || ReflectUtil.isNonPublicProxyClass(this)) {
-                        s.checkPackageAccess(pkg);
-                    }
+    private void checkPackageAccess(SecurityManager sm, final ClassLoader ccl,
+                                    boolean checkProxyInterfaces) {
+        final ClassLoader cl = getClassLoader0();
+
+        if (ReflectUtil.needsPackageAccessCheck(ccl, cl)) {
+            String pkg = this.getPackageName();
+            if (pkg != null && !pkg.isEmpty()) {
+                // skip the package access check on a proxy class in default proxy package
+                if (!Proxy.isProxyClass(this) || ReflectUtil.isNonPublicProxyClass(this)) {
+                    sm.checkPackageAccess(pkg);
                 }
             }
-            // check package access on the proxy interfaces
-            if (checkProxyInterfaces && Proxy.isProxyClass(this)) {
-                ReflectUtil.checkProxyPackageAccess(ccl, this.getInterfaces());
-            }
+        }
+        // check package access on the proxy interfaces
+        if (checkProxyInterfaces && Proxy.isProxyClass(this)) {
+            ReflectUtil.checkProxyPackageAccess(ccl, this.getInterfaces());
         }
     }
 
@@ -2755,11 +2786,9 @@
             while (c.isArray()) {
                 c = c.getComponentType();
             }
-            String baseName = c.getName();
-            int index = baseName.lastIndexOf('.');
-            if (index != -1) {
-                name = baseName.substring(0, index).replace('.', '/')
-                    +"/"+name;
+            String baseName = c.getPackageName();
+            if (baseName != null && !baseName.isEmpty()) {
+                name = baseName.replace('.', '/') + "/" + name;
             }
         } else {
             name = name.substring(1);
@@ -3233,7 +3262,7 @@
                 return constructor;
             }
         }
-        throw new NoSuchMethodException(getName() + ".<init>" + argumentTypesToString(parameterTypes));
+        throw new NoSuchMethodException(methodToString("<init>", parameterTypes));
     }
 
     //
@@ -3294,8 +3323,11 @@
     private native Constructor<T>[] getDeclaredConstructors0(boolean publicOnly);
     private native Class<?>[]   getDeclaredClasses0();
 
-    private static String        argumentTypesToString(Class<?>[] argTypes) {
-        StringJoiner sj = new StringJoiner(", ", "(", ")");
+    /**
+     * Helper method to get the method name from arguments.
+     */
+    private String methodToString(String name, Class<?>[] argTypes) {
+        StringJoiner sj = new StringJoiner(", ", getName() + "." + name + "(", ")");
         if (argTypes != null) {
             for (int i = 0; i < argTypes.length; i++) {
                 Class<?> c = argTypes[i];
--- a/jdk/src/java.base/share/classes/java/lang/SecurityManager.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/SecurityManager.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,30 @@
 
 package java.lang;
 
-import java.security.*;
+import java.lang.RuntimePermission;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleDescriptor.Exports;
+import java.lang.module.ModuleDescriptor.Opens;
+import java.lang.reflect.Layer;
+import java.lang.reflect.Member;
+import java.lang.reflect.Module;
 import java.io.FileDescriptor;
 import java.io.File;
 import java.io.FilePermission;
-import java.util.PropertyPermission;
-import java.lang.RuntimePermission;
+import java.net.InetAddress;
 import java.net.SocketPermission;
-import java.net.NetPermission;
-import java.util.Hashtable;
-import java.net.InetAddress;
-import java.lang.reflect.*;
-import java.net.URL;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.Permission;
+import java.security.PrivilegedAction;
+import java.security.Security;
+import java.security.SecurityPermission;
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.PropertyPermission;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import jdk.internal.reflect.CallerSensitive;
 import sun.security.util.SecurityConstants;
@@ -1415,46 +1427,108 @@
             }
         }
 
-        if (packages == null)
+        if (packages == null) {
             packages = new String[0];
+        }
         return packages;
     }
 
+    // The non-exported packages of the modules in the boot layer that are
+    // loaded by the platform class loader or its ancestors. A non-exported
+    // package is a package that either is not exported at all by its containing
+    // module or is exported in a qualified fashion by its containing module.
+    private static final Set<String> nonExportedPkgs;
+
+    static {
+        // Get the modules in the boot layer
+        Stream<Module> bootLayerModules = Layer.boot().modules().stream();
+
+        // Filter out the modules loaded by the boot or platform loader
+        PrivilegedAction<Set<Module>> pa = () ->
+            bootLayerModules.filter(SecurityManager::isBootOrPlatformModule)
+                            .collect(Collectors.toSet());
+        Set<Module> modules = AccessController.doPrivileged(pa);
+
+        // Filter out the non-exported packages
+        nonExportedPkgs = modules.stream()
+                                 .map(Module::getDescriptor)
+                                 .map(SecurityManager::nonExportedPkgs)
+                                 .flatMap(Set::stream)
+                                 .collect(Collectors.toSet());
+    }
+
+    /**
+     * Returns true if the module's loader is the boot or platform loader.
+     */
+    private static boolean isBootOrPlatformModule(Module m) {
+        return m.getClassLoader() == null ||
+               m.getClassLoader() == ClassLoader.getPlatformClassLoader();
+    }
+
     /**
-     * Throws a <code>SecurityException</code> if the
-     * calling thread is not allowed to access the package specified by
-     * the argument.
-     * <p>
-     * This method is used by the <code>loadClass</code> method of class
-     * loaders.
+     * Returns the non-exported packages of the specified module.
+     */
+    private static Set<String> nonExportedPkgs(ModuleDescriptor md) {
+        // start with all packages in the module
+        Set<String> pkgs = new HashSet<>(md.packages());
+
+        // remove the non-qualified exported packages
+        md.exports().stream()
+                    .filter(p -> !p.isQualified())
+                    .map(Exports::source)
+                    .forEach(pkgs::remove);
+
+        // remove the non-qualified open packages
+        md.opens().stream()
+                  .filter(p -> !p.isQualified())
+                  .map(Opens::source)
+                  .forEach(pkgs::remove);
+
+        return pkgs;
+    }
+
+    /**
+     * Throws a {@code SecurityException} if the calling thread is not allowed
+     * to access the specified package.
      * <p>
-     * This method first gets a list of
-     * restricted packages by obtaining a comma-separated list from
-     * a call to
-     * <code>java.security.Security.getProperty("package.access")</code>,
-     * and checks to see if <code>pkg</code> starts with or equals
-     * any of the restricted packages. If it does, then
-     * <code>checkPermission</code> gets called with the
-     * <code>RuntimePermission("accessClassInPackage."+pkg)</code>
-     * permission.
+     * This method is called by the {@code loadClass} method of class loaders.
+     * <p>
+     * This method checks if the specified package starts with or equals
+     * any of the packages in the {@code package.access} Security Property.
+     * An implementation may also check the package against an additional
+     * list of restricted packages as noted below. If the package is restricted,
+     * {@link #checkPermission(Permission)} is called with a
+     * {@code RuntimePermission("accessClassInPackage."+pkg)} permission.
      * <p>
-     * If this method is overridden, then
-     * <code>super.checkPackageAccess</code> should be called
-     * as the first line in the overridden method.
+     * If this method is overridden, then {@code super.checkPackageAccess}
+     * should be called as the first line in the overridden method.
+     *
+     * @implNote
+     * This implementation also restricts all non-exported packages of modules
+     * loaded by {@linkplain ClassLoader#getPlatformClassLoader
+     * the platform class loader} or its ancestors. A "non-exported package"
+     * refers to a package that is not exported to all modules. Specifically,
+     * it refers to a package that either is not exported at all by its
+     * containing module or is exported in a qualified fashion by its
+     * containing module.
      *
      * @param      pkg   the package name.
-     * @exception  SecurityException  if the calling thread does not have
+     * @throws     SecurityException  if the calling thread does not have
      *             permission to access the specified package.
-     * @exception  NullPointerException if the package name argument is
-     *             <code>null</code>.
-     * @see        java.lang.ClassLoader#loadClass(java.lang.String, boolean)
-     *  loadClass
+     * @throws     NullPointerException if the package name argument is
+     *             {@code null}.
+     * @see        java.lang.ClassLoader#loadClass(String, boolean) loadClass
      * @see        java.security.Security#getProperty getProperty
-     * @see        #checkPermission(java.security.Permission) checkPermission
+     * @see        #checkPermission(Permission) checkPermission
      */
     public void checkPackageAccess(String pkg) {
-        if (pkg == null) {
-            throw new NullPointerException("package name can't be null");
+        Objects.requireNonNull(pkg, "package name can't be null");
+
+        // check if pkg is not exported to all modules
+        if (nonExportedPkgs.contains(pkg)) {
+            checkPermission(
+                new RuntimePermission("accessClassInPackage." + pkg));
+            return;
         }
 
         String[] restrictedPkgs;
@@ -1512,36 +1586,48 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
-     * calling thread is not allowed to define classes in the package
-     * specified by the argument.
+     * Throws a {@code SecurityException} if the calling thread is not
+     * allowed to define classes in the specified package.
      * <p>
-     * This method is used by the <code>loadClass</code> method of some
+     * This method is called by the {@code loadClass} method of some
      * class loaders.
      * <p>
-     * This method first gets a list of restricted packages by
-     * obtaining a comma-separated list from a call to
-     * <code>java.security.Security.getProperty("package.definition")</code>,
-     * and checks to see if <code>pkg</code> starts with or equals
-     * any of the restricted packages. If it does, then
-     * <code>checkPermission</code> gets called with the
-     * <code>RuntimePermission("defineClassInPackage."+pkg)</code>
-     * permission.
+     * This method checks if the specified package starts with or equals
+     * any of the packages in the {@code package.definition} Security
+     * Property. An implementation may also check the package against an
+     * additional list of restricted packages as noted below. If the package
+     * is restricted, {@link #checkPermission(Permission)} is called with a
+     * {@code RuntimePermission("defineClassInPackage."+pkg)} permission.
      * <p>
-     * If this method is overridden, then
-     * <code>super.checkPackageDefinition</code> should be called
-     * as the first line in the overridden method.
+     * If this method is overridden, then {@code super.checkPackageDefinition}
+     * should be called as the first line in the overridden method.
+     *
+     * @implNote
+     * This implementation also restricts all non-exported packages of modules
+     * loaded by {@linkplain ClassLoader#getPlatformClassLoader
+     * the platform class loader} or its ancestors. A "non-exported package"
+     * refers to a package that is not exported to all modules. Specifically,
+     * it refers to a package that either is not exported at all by its
+     * containing module or is exported in a qualified fashion by its
+     * containing module.
      *
      * @param      pkg   the package name.
-     * @exception  SecurityException  if the calling thread does not have
+     * @throws     SecurityException  if the calling thread does not have
      *             permission to define classes in the specified package.
-     * @see        java.lang.ClassLoader#loadClass(java.lang.String, boolean)
+     * @throws     NullPointerException if the package name argument is
+     *             {@code null}.
+     * @see        java.lang.ClassLoader#loadClass(String, boolean)
      * @see        java.security.Security#getProperty getProperty
-     * @see        #checkPermission(java.security.Permission) checkPermission
+     * @see        #checkPermission(Permission) checkPermission
      */
     public void checkPackageDefinition(String pkg) {
-        if (pkg == null) {
-            throw new NullPointerException("package name can't be null");
+        Objects.requireNonNull(pkg, "package name can't be null");
+
+        // check if pkg is not exported to all modules
+        if (nonExportedPkgs.contains(pkg)) {
+            checkPermission(
+                new RuntimePermission("defineClassInPackage." + pkg));
+            return;
         }
 
         String[] pkgs;
--- a/jdk/src/java.base/share/classes/java/lang/System.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/System.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -310,12 +310,13 @@
      * @see SecurityManager#checkPermission
      * @see java.lang.RuntimePermission
      */
-    public static
-    void setSecurityManager(final SecurityManager s) {
-        try {
-            s.checkPackageAccess("java.lang");
-        } catch (Exception e) {
-            // no-op
+    public static void setSecurityManager(final SecurityManager s) {
+        if (s != null) {
+            try {
+                s.checkPackageAccess("java.lang");
+            } catch (Exception e) {
+                // no-op
+            }
         }
         setSecurityManager0(s);
     }
--- a/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java	Sat Jan 21 03:53:21 2017 +0000
@@ -28,6 +28,8 @@
 import static java.lang.invoke.MethodHandleStatics.*;
 import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
 
+import jdk.internal.vm.annotation.Stable;
+
 /**
  * A {@code CallSite} is a holder for a variable {@link MethodHandle},
  * which is called its {@code target}.
@@ -215,19 +217,36 @@
     public abstract MethodHandle dynamicInvoker();
 
     /*non-public*/ MethodHandle makeDynamicInvoker() {
-        MethodHandle getTarget = GET_TARGET.bindArgumentL(0, this);
+        MethodHandle getTarget = getTargetHandle().bindArgumentL(0, this);
         MethodHandle invoker = MethodHandles.exactInvoker(this.type());
         return MethodHandles.foldArguments(invoker, getTarget);
     }
 
-    private static final MethodHandle GET_TARGET;
-    private static final MethodHandle THROW_UCS;
-    static {
+    private static @Stable MethodHandle GET_TARGET;
+    private static MethodHandle getTargetHandle() {
+        MethodHandle handle = GET_TARGET;
+        if (handle != null) {
+            return handle;
+        }
         try {
-            GET_TARGET = IMPL_LOOKUP.
-                findVirtual(CallSite.class, "getTarget", MethodType.methodType(MethodHandle.class));
-            THROW_UCS = IMPL_LOOKUP.
-                findStatic(CallSite.class, "uninitializedCallSite", MethodType.methodType(Object.class, Object[].class));
+            return GET_TARGET = IMPL_LOOKUP.
+                    findVirtual(CallSite.class, "getTarget",
+                                MethodType.methodType(MethodHandle.class));
+        } catch (ReflectiveOperationException e) {
+            throw newInternalError(e);
+        }
+    }
+
+    private static @Stable MethodHandle THROW_UCS;
+    private static MethodHandle uninitializedCallSiteHandle() {
+        MethodHandle handle = THROW_UCS;
+        if (handle != null) {
+            return handle;
+        }
+        try {
+            return THROW_UCS = IMPL_LOOKUP.
+                findStatic(CallSite.class, "uninitializedCallSite",
+                           MethodType.methodType(Object.class, Object[].class));
         } catch (ReflectiveOperationException e) {
             throw newInternalError(e);
         }
@@ -242,7 +261,7 @@
         MethodType basicType = targetType.basicType();
         MethodHandle invoker = basicType.form().cachedMethodHandle(MethodTypeForm.MH_UNINIT_CS);
         if (invoker == null) {
-            invoker = THROW_UCS.asType(basicType);
+            invoker = uninitializedCallSiteHandle().asType(basicType);
             invoker = basicType.form().setCachedMethodHandle(MethodTypeForm.MH_UNINIT_CS, invoker);
         }
         // unchecked view is OK since no values will be received or returned
@@ -250,12 +269,16 @@
     }
 
     // unsafe stuff:
-    private static final long  TARGET_OFFSET;
-    private static final long CONTEXT_OFFSET;
-    static {
+    private static @Stable long TARGET_OFFSET;
+    private static long getTargetOffset() {
+        long offset = TARGET_OFFSET;
+        if (offset > 0) {
+            return offset;
+        }
         try {
-            TARGET_OFFSET  = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("target"));
-            CONTEXT_OFFSET = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("context"));
+            offset = TARGET_OFFSET = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("target"));
+            assert(offset > 0);
+            return offset;
         } catch (Exception ex) { throw newInternalError(ex); }
     }
 
@@ -265,7 +288,7 @@
     }
     /*package-private*/
     MethodHandle getTargetVolatile() {
-        return (MethodHandle) UNSAFE.getObjectVolatile(this, TARGET_OFFSET);
+        return (MethodHandle) UNSAFE.getObjectVolatile(this, getTargetOffset());
     }
     /*package-private*/
     void setTargetVolatile(MethodHandle newTarget) {
@@ -324,7 +347,7 @@
                         final int NON_SPREAD_ARG_COUNT = 3;  // (caller, name, type)
                         if (NON_SPREAD_ARG_COUNT + argv.length > MethodType.MAX_MH_ARITY)
                             throw new BootstrapMethodError("too many bootstrap method arguments");
-                        MethodType bsmType = bootstrapMethod.type();
+
                         MethodType invocationType = MethodType.genericMethodType(NON_SPREAD_ARG_COUNT + argv.length);
                         MethodHandle typedBSM = bootstrapMethod.asType(invocationType);
                         MethodHandle spreader = invocationType.invokers().spreadInvoker(NON_SPREAD_ARG_COUNT);
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -846,8 +846,11 @@
             // that does not bluntly restrict classes under packages within
             // java.base from looking up MethodHandles or VarHandles.
             if (allowedModes == ALL_MODES && lookupClass.getClassLoader() == null) {
-                if ((name.startsWith("java.") && !name.startsWith("java.util.concurrent.")) ||
-                        (name.startsWith("sun.") && !name.startsWith("sun.invoke."))) {
+                if ((name.startsWith("java.") &&
+                     !name.equals("java.lang.Thread") &&
+                     !name.startsWith("java.util.concurrent.")) ||
+                    (name.startsWith("sun.") &&
+                     !name.startsWith("sun.invoke."))) {
                     throw newIllegalArgumentException("illegal lookupClass: " + lookupClass);
                 }
             }
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1128,7 +1128,7 @@
     public String toMethodDescriptorString() {
         String desc = methodDescriptor;
         if (desc == null) {
-            desc = BytecodeDescriptor.unparse(this);
+            desc = BytecodeDescriptor.unparseMethod(this.rtype, this.ptypes);
             methodDescriptor = desc;
         }
         return desc;
@@ -1256,7 +1256,7 @@
         private final ReferenceQueue<T> stale;
 
         public ConcurrentWeakInternSet() {
-            this.map = new ConcurrentHashMap<>();
+            this.map = new ConcurrentHashMap<>(512);
             this.stale = new ReferenceQueue<>();
         }
 
--- a/jdk/src/java.base/share/classes/java/net/SocketInputStream.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/SocketInputStream.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -155,11 +155,12 @@
         }
 
         // bounds check
-        if (length <= 0 || off < 0 || off + length > b.length) {
+        if (length <= 0 || off < 0 || length > b.length - off) {
             if (length == 0) {
                 return 0;
             }
-            throw new ArrayIndexOutOfBoundsException();
+            throw new ArrayIndexOutOfBoundsException("length == " + length
+                    + " off == " + off + " buffer length == " + b.length);
         }
 
         boolean gotReset = false;
--- a/jdk/src/java.base/share/classes/java/net/SocketOutputStream.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/SocketOutputStream.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -97,11 +97,13 @@
      */
     private void socketWrite(byte b[], int off, int len) throws IOException {
 
-        if (len <= 0 || off < 0 || off + len > b.length) {
+
+        if (len <= 0 || off < 0 || len > b.length - off) {
             if (len == 0) {
                 return;
             }
-            throw new ArrayIndexOutOfBoundsException();
+            throw new ArrayIndexOutOfBoundsException("len == " + len
+                    + " off == " + off + " buffer length == " + b.length);
         }
 
         FileDescriptor fd = impl.acquireFD();
--- a/jdk/src/java.base/share/classes/java/net/URL.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/URL.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1556,9 +1556,6 @@
                 path = file;
         }
 
-        if (port == -1) {
-            port = 0;
-        }
         // Set the object fields.
         this.protocol = protocol;
         this.host = host;
--- a/jdk/src/java.base/share/classes/java/net/URLClassLoader.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/URLClassLoader.java	Sat Jan 21 03:53:21 2017 +0000
@@ -115,8 +115,8 @@
         if (security != null) {
             security.checkCreateClassLoader();
         }
-        this.ucp = new URLClassPath(urls);
         this.acc = AccessController.getContext();
+        this.ucp = new URLClassPath(urls, acc);
     }
 
     URLClassLoader(String name, URL[] urls, ClassLoader parent,
@@ -127,8 +127,8 @@
         if (security != null) {
             security.checkCreateClassLoader();
         }
-        this.ucp = new URLClassPath(urls);
         this.acc = acc;
+        this.ucp = new URLClassPath(urls, acc);
     }
 
     /**
@@ -159,8 +159,8 @@
         if (security != null) {
             security.checkCreateClassLoader();
         }
-        this.ucp = new URLClassPath(urls);
         this.acc = AccessController.getContext();
+        this.ucp = new URLClassPath(urls, acc);
     }
 
     URLClassLoader(URL[] urls, AccessControlContext acc) {
@@ -170,8 +170,8 @@
         if (security != null) {
             security.checkCreateClassLoader();
         }
-        this.ucp = new URLClassPath(urls);
         this.acc = acc;
+        this.ucp = new URLClassPath(urls, acc);
     }
 
     /**
@@ -203,8 +203,8 @@
         if (security != null) {
             security.checkCreateClassLoader();
         }
-        this.ucp = new URLClassPath(urls, factory);
         this.acc = AccessController.getContext();
+        this.ucp = new URLClassPath(urls, factory, acc);
     }
 
 
@@ -238,8 +238,8 @@
         if (security != null) {
             security.checkCreateClassLoader();
         }
-        this.ucp = new URLClassPath(urls);
         this.acc = AccessController.getContext();
+        this.ucp = new URLClassPath(urls, acc);
     }
 
     /**
@@ -271,8 +271,8 @@
         if (security != null) {
             security.checkCreateClassLoader();
         }
-        this.ucp = new URLClassPath(urls, factory);
         this.acc = AccessController.getContext();
+        this.ucp = new URLClassPath(urls, factory, acc);
     }
 
     /* A map (used as a set) to keep track of closeable local resources
--- a/jdk/src/java.base/share/classes/java/net/URLStreamHandler.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/URLStreamHandler.java	Sat Jan 21 03:53:21 2017 +0000
@@ -161,9 +161,9 @@
             (spec.charAt(start + 1) == '/')) {
             start += 2;
             i = spec.indexOf('/', start);
-            if (i < 0) {
+            if (i < 0 || i > limit) {
                 i = spec.indexOf('?', start);
-                if (i < 0)
+                if (i < 0 || i > limit)
                     i = limit;
             }
 
@@ -171,8 +171,14 @@
 
             int ind = authority.indexOf('@');
             if (ind != -1) {
-                userInfo = authority.substring(0, ind);
-                host = authority.substring(ind+1);
+                if (ind != authority.lastIndexOf('@')) {
+                    // more than one '@' in authority. This is not server based
+                    userInfo = null;
+                    host = null;
+                } else {
+                    userInfo = authority.substring(0, ind);
+                    host = authority.substring(ind+1);
+                }
             } else {
                 userInfo = null;
             }
--- a/jdk/src/java.base/share/classes/java/util/ResourceBundle.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/ResourceBundle.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UncheckedIOException;
+import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.SoftReference;
 import java.lang.ref.WeakReference;
@@ -365,7 +366,7 @@
                 @Override
                 public ResourceBundle getBundle(String baseName, Locale locale, Module module) {
                     // use the given module as the caller to bypass the access check
-                    return getBundleImpl(module, module, getLoader(module),
+                    return getBundleImpl(module, module,
                                          baseName, locale, Control.INSTANCE);
                 }
 
@@ -537,63 +538,19 @@
         return locale;
     }
 
-    /*
-     * Automatic determination of the ClassLoader to be used to load
-     * resources on behalf of the client.
-     */
-    private static ClassLoader getLoader(Class<?> caller) {
-        ClassLoader cl = caller == null ? null : caller.getClassLoader();
-        if (cl == null) {
-            // When the caller's loader is the boot class loader, cl is null
-            // here. In that case, ClassLoader.getSystemClassLoader() may
-            // return the same class loader that the application is
-            // using. We therefore use a wrapper ClassLoader to create a
-            // separate scope for bundles loaded on behalf of the Java
-            // runtime so that these bundles cannot be returned from the
-            // cache to the application (5048280).
-            cl = RBClassLoader.INSTANCE;
-        }
-        return cl;
-    }
-
     private static ClassLoader getLoader(Module module) {
         PrivilegedAction<ClassLoader> pa = module::getClassLoader;
         return AccessController.doPrivileged(pa);
     }
 
     /**
-     * A wrapper of ClassLoader.getSystemClassLoader().
+     * @param module a non-null-screened module form the {@link CacheKey#getModule()}.
+     * @return the ClassLoader to use in {@link Control#needsReload}
+     *         and {@link Control#newBundle}
      */
-    private static class RBClassLoader extends ClassLoader {
-        private static final RBClassLoader INSTANCE = AccessController.doPrivileged(
-                    new PrivilegedAction<RBClassLoader>() {
-                        public RBClassLoader run() {
-                            return new RBClassLoader();
-                        }
-                    });
-        private RBClassLoader() {
-        }
-        public Class<?> loadClass(String name) throws ClassNotFoundException {
-            ClassLoader loader = ClassLoader.getSystemClassLoader();
-            if (loader != null) {
-                return loader.loadClass(name);
-            }
-            return Class.forName(name);
-        }
-        public URL getResource(String name) {
-            ClassLoader loader = ClassLoader.getSystemClassLoader();
-            if (loader != null) {
-                return loader.getResource(name);
-            }
-            return ClassLoader.getSystemResource(name);
-        }
-        public InputStream getResourceAsStream(String name) {
-            ClassLoader loader = ClassLoader.getSystemClassLoader();
-            if (loader != null) {
-                return loader.getResourceAsStream(name);
-            }
-            return ClassLoader.getSystemResourceAsStream(name);
-        }
+    private static ClassLoader getLoaderForControl(Module module) {
+        ClassLoader loader = getLoader(module);
+        return loader == null ? ClassLoader.getSystemClassLoader() : loader;
     }
 
     /**
@@ -610,23 +567,23 @@
 
     /**
      * Key used for cached resource bundles.  The key checks the base
-     * name, the locale, the class loader, and the caller module
+     * name, the locale, the bundle module, and the caller module
      * to determine if the resource is a match to the requested one.
-     * The loader may be null, but the base name, the locale and
-     * module must have a non-null value.
+     * The base name, the locale and both modules must have a non-null value.
      */
-    private static class CacheKey implements Cloneable {
+    private static final class CacheKey {
         // These four are the actual keys for lookup in Map.
-        private String name;
-        private Locale locale;
-        private KeyElementReference<ClassLoader> loaderRef;
-        private KeyElementReference<Module> moduleRef;
-        private KeyElementReference<Module> callerRef;
-
+        private final String name;
+        private volatile Locale locale;
+        private final KeyElementReference<Module> moduleRef;
+        private final KeyElementReference<Module> callerRef;
+        // this is the part of hashCode that pertains to module and callerModule
+        // which can be GCed..
+        private final int modulesHash;
 
         // bundle format which is necessary for calling
         // Control.needsReload().
-        private String format;
+        private volatile String format;
 
         // These time values are in CacheKey so that NONEXISTENT_BUNDLE
         // doesn't need to be cloned for caching.
@@ -639,63 +596,55 @@
         private volatile long expirationTime;
 
         // Placeholder for an error report by a Throwable
-        private Throwable cause;
-
-        // Hash code value cache to avoid recalculating the hash code
-        // of this instance.
-        private int hashCodeCache;
+        private volatile Throwable cause;
 
         // ResourceBundleProviders for loading ResourceBundles
-        private ServiceLoader<ResourceBundleProvider> providers;
-        private boolean providersChecked;
+        private volatile ServiceLoader<ResourceBundleProvider> providers;
+        private volatile boolean providersChecked;
 
         // Boolean.TRUE if the factory method caller provides a ResourceBundleProvier.
-        private Boolean callerHasProvider;
+        private volatile Boolean callerHasProvider;
 
-        CacheKey(String baseName, Locale locale, ClassLoader loader, Module module, Module caller) {
+        CacheKey(String baseName, Locale locale, Module module, Module caller) {
             Objects.requireNonNull(module);
+            Objects.requireNonNull(caller);
 
             this.name = baseName;
             this.locale = locale;
-            if (loader == null) {
-                this.loaderRef = null;
-            } else {
-                this.loaderRef = new KeyElementReference<>(loader, referenceQueue, this);
-            }
             this.moduleRef = new KeyElementReference<>(module, referenceQueue, this);
             this.callerRef = new KeyElementReference<>(caller, referenceQueue, this);
+            this.modulesHash = module.hashCode() ^ caller.hashCode();
+        }
 
-            calculateHashCode();
+        CacheKey(CacheKey src) {
+            // Create References to src's modules
+            this.moduleRef = new KeyElementReference<>(
+                Objects.requireNonNull(src.getModule()), referenceQueue, this);
+            this.callerRef = new KeyElementReference<>(
+                Objects.requireNonNull(src.getCallerModule()), referenceQueue, this);
+            // Copy fields from src. ResourceBundleProviders related fields
+            // and "cause" should not be copied.
+            this.name = src.name;
+            this.locale = src.locale;
+            this.modulesHash = src.modulesHash;
+            this.format = src.format;
+            this.loadTime = src.loadTime;
+            this.expirationTime = src.expirationTime;
         }
 
         String getName() {
             return name;
         }
 
-        CacheKey setName(String baseName) {
-            if (!this.name.equals(baseName)) {
-                this.name = baseName;
-                calculateHashCode();
-            }
-            return this;
-        }
-
         Locale getLocale() {
             return locale;
         }
 
         CacheKey setLocale(Locale locale) {
-            if (!this.locale.equals(locale)) {
-                this.locale = locale;
-                calculateHashCode();
-            }
+            this.locale = locale;
             return this;
         }
 
-        ClassLoader getLoader() {
-            return (loaderRef != null) ? loaderRef.get() : null;
-        }
-
         Module getModule() {
             return moduleRef.get();
         }
@@ -728,7 +677,7 @@
             try {
                 final CacheKey otherEntry = (CacheKey)other;
                 //quick check to see if they are not equal
-                if (hashCodeCache != otherEntry.hashCodeCache) {
+                if (modulesHash != otherEntry.modulesHash) {
                     return false;
                 }
                 //are the names the same?
@@ -739,24 +688,11 @@
                 if (!locale.equals(otherEntry.locale)) {
                     return false;
                 }
-                //are refs (both non-null) or (both null)?
-                if (loaderRef == null) {
-                    return otherEntry.loaderRef == null;
-                }
-                ClassLoader loader = getLoader();
+                // are modules and callerModules the same and non-null?
                 Module module = getModule();
                 Module caller = getCallerModule();
-
-                return (otherEntry.loaderRef != null)
-                        // with a null reference we can no longer find
-                        // out which class loader or module was referenced; so
-                        // treat it as unequal
-                        && (loader != null)
-                        && (loader == otherEntry.getLoader())
-                        && (module != null)
-                        && (module.equals(otherEntry.getModule()))
-                        && (caller != null)
-                        && (caller.equals(otherEntry.getCallerModule()));
+                return ((module != null) && (module.equals(otherEntry.getModule())) &&
+                        (caller != null) && (caller.equals(otherEntry.getCallerModule())));
             } catch (NullPointerException | ClassCastException e) {
             }
             return false;
@@ -764,51 +700,7 @@
 
         @Override
         public int hashCode() {
-            return hashCodeCache;
-        }
-
-        private void calculateHashCode() {
-            hashCodeCache = name.hashCode() << 3;
-            hashCodeCache ^= locale.hashCode();
-            ClassLoader loader = getLoader();
-            if (loader != null) {
-                hashCodeCache ^= loader.hashCode();
-            }
-            Module module = getModule();
-            if (module != null) {
-                hashCodeCache ^= module.hashCode();
-            }
-            Module caller = getCallerModule();
-            if (caller != null) {
-                hashCodeCache ^= caller.hashCode();
-            }
-        }
-
-        @Override
-        public Object clone() {
-            try {
-                CacheKey clone = (CacheKey) super.clone();
-                if (loaderRef != null) {
-                    clone.loaderRef = new KeyElementReference<>(getLoader(),
-                                                                referenceQueue, clone);
-                }
-                clone.moduleRef = new KeyElementReference<>(getModule(),
-                                                            referenceQueue, clone);
-                clone.callerRef = new KeyElementReference<>(getCallerModule(),
-                                                            referenceQueue, clone);
-
-                // Clear the reference to ResourceBundleProviders and the flag
-                clone.providers = null;
-                clone.providersChecked = false;
-                // Clear the reference to a Throwable
-                clone.cause = null;
-                // Clear callerHasProvider
-                clone.callerHasProvider = null;
-                return clone;
-            } catch (CloneNotSupportedException e) {
-                //this should never happen
-                throw new InternalError(e);
-            }
+            return (name.hashCode() << 3) ^ locale.hashCode() ^ modulesHash;
         }
 
         String getFormat() {
@@ -845,8 +737,12 @@
                     l = "\"\"";
                 }
             }
-            return "CacheKey[" + name + ", lc=" + l + ", ldr=" + getLoader()
-                + "(format=" + format + ")]";
+            return "CacheKey[" + name +
+                   ", locale=" + l +
+                   ", module=" + getModule() +
+                   ", callerModule=" + getCallerModule() +
+                   ", format=" + format +
+                   "]";
         }
     }
 
@@ -1568,7 +1464,7 @@
                                                 Locale locale,
                                                 Class<?> caller,
                                                 Control control) {
-        return getBundleImpl(baseName, locale, caller, getLoader(caller), control);
+        return getBundleImpl(baseName, locale, caller, caller.getClassLoader(), control);
     }
 
     /**
@@ -1587,26 +1483,25 @@
                                                 Class<?> caller,
                                                 ClassLoader loader,
                                                 Control control) {
-        if (caller != null && caller.getModule().isNamed()) {
-            Module module = caller.getModule();
-            ClassLoader ml = getLoader(module);
-            // get resource bundles for a named module only
-            // if loader is the module's class loader
-            if (loader == ml || (ml == null && loader == RBClassLoader.INSTANCE)) {
-                return getBundleImpl(module, module, loader, baseName, locale, control);
-            }
-        }
-        // find resource bundles from unnamed module
-        Module unnamedModule = loader != null
-            ? loader.getUnnamedModule()
-            : ClassLoader.getSystemClassLoader().getUnnamedModule();
-
         if (caller == null) {
             throw new InternalError("null caller");
         }
+        Module callerModule = caller.getModule();
 
-        Module callerModule = caller.getModule();
-        return getBundleImpl(callerModule, unnamedModule, loader, baseName, locale, control);
+        // get resource bundles for a named module only if loader is the module's class loader
+        if (callerModule.isNamed() && loader == getLoader(callerModule)) {
+            return getBundleImpl(callerModule, callerModule, baseName, locale, control);
+        }
+
+        // find resource bundles from unnamed module of given class loader
+        // Java agent can add to the bootclasspath e.g. via
+        // java.lang.instrument.Instrumentation and load classes in unnamed module.
+        // It may call RB::getBundle that will end up here with loader == null.
+        Module unnamedModule = loader != null
+            ? loader.getUnnamedModule()
+            : BootLoader.getUnnamedModule();
+
+        return getBundleImpl(callerModule, unnamedModule, baseName, locale, control);
     }
 
     private static ResourceBundle getBundleFromModule(Class<?> caller,
@@ -1622,12 +1517,11 @@
                 sm.checkPermission(GET_CLASSLOADER_PERMISSION);
             }
         }
-        return getBundleImpl(callerModule, module, getLoader(module), baseName, locale, control);
+        return getBundleImpl(callerModule, module, baseName, locale, control);
     }
 
     private static ResourceBundle getBundleImpl(Module callerModule,
                                                 Module module,
-                                                ClassLoader loader,
                                                 String baseName,
                                                 Locale locale,
                                                 Control control) {
@@ -1636,10 +1530,10 @@
         }
 
         // We create a CacheKey here for use by this call. The base name
-        // loader, and module will never change during the bundle loading
+        // and modules will never change during the bundle loading
         // process. We have to make sure that the locale is set before
         // using it as a cache key.
-        CacheKey cacheKey = new CacheKey(baseName, locale, loader, module, callerModule);
+        CacheKey cacheKey = new CacheKey(baseName, locale, module, callerModule);
         ResourceBundle bundle = null;
 
         // Quick lookup of the cache.
@@ -1708,6 +1602,11 @@
             bundle = baseBundle;
         }
 
+        // keep callerModule and module reachable for as long as we are operating
+        // with WeakReference(s) to them (in CacheKey)...
+        Reference.reachabilityFence(callerModule);
+        Reference.reachabilityFence(module);
+
         return bundle;
     }
 
@@ -1745,7 +1644,7 @@
         }
 
         // Before we do the real loading work, see whether we need to
-        // do some housekeeping: If references to class loaders or
+        // do some housekeeping: If references to modules or
         // resource bundles have been nulled out, remove all related
         // information from the cache.
         Object ref;
@@ -1781,31 +1680,24 @@
         }
 
         if (bundle != NONEXISTENT_BUNDLE) {
-            CacheKey constKey = (CacheKey) cacheKey.clone();
             trace("findBundle: %d %s %s formats: %s%n", index, candidateLocales, cacheKey, formats);
-            try {
-                if (module.isNamed()) {
-                    bundle = loadBundle(cacheKey, formats, control, module, callerModule);
-                } else {
-                    bundle = loadBundle(cacheKey, formats, control, expiredBundle);
+            if (module.isNamed()) {
+                bundle = loadBundle(cacheKey, formats, control, module, callerModule);
+            } else {
+                bundle = loadBundle(cacheKey, formats, control, expiredBundle);
+            }
+            if (bundle != null) {
+                if (bundle.parent == null) {
+                    bundle.setParent(parent);
                 }
-                if (bundle != null) {
-                    if (bundle.parent == null) {
-                        bundle.setParent(parent);
-                    }
-                    bundle.locale = targetLocale;
-                    bundle = putBundleInCache(cacheKey, bundle, control);
-                    return bundle;
-                }
+                bundle.locale = targetLocale;
+                bundle = putBundleInCache(cacheKey, bundle, control);
+                return bundle;
+            }
 
-                // Put NONEXISTENT_BUNDLE in the cache as a mark that there's no bundle
-                // instance for the locale.
-                putBundleInCache(cacheKey, NONEXISTENT_BUNDLE, control);
-            } finally {
-                if (constKey.getCause() instanceof InterruptedException) {
-                    Thread.currentThread().interrupt();
-                }
-            }
+            // Put NONEXISTENT_BUNDLE in the cache as a mark that there's no bundle
+            // instance for the locale.
+            putBundleInCache(cacheKey, NONEXISTENT_BUNDLE, control);
         }
         return parent;
     }
@@ -1991,12 +1883,20 @@
         // specified by the getFormats() value.
         Locale targetLocale = cacheKey.getLocale();
 
+        Module module = cacheKey.getModule();
+        if (module == null) {
+            // should not happen
+            throw new InternalError(
+                "Module for cache key: " + cacheKey + " has been GCed.");
+        }
+        ClassLoader loader = getLoaderForControl(module);
+
         ResourceBundle bundle = null;
         for (String format : formats) {
             try {
                 // ResourceBundle.Control.newBundle may be overridden
                 bundle = control.newBundle(cacheKey.getName(), targetLocale, format,
-                                           cacheKey.getLoader(), reload);
+                                           loader, reload);
             } catch (LinkageError | Exception error) {
                 // We need to handle the LinkageError case due to
                 // inconsistent case-sensitivity in ClassLoader.
@@ -2138,12 +2038,15 @@
                         if (!bundle.expired && expirationTime >= 0 &&
                             expirationTime <= System.currentTimeMillis()) {
                             try {
-                                bundle.expired = control.needsReload(key.getName(),
-                                                                     key.getLocale(),
-                                                                     key.getFormat(),
-                                                                     key.getLoader(),
-                                                                     bundle,
-                                                                     key.loadTime);
+                                Module module = cacheKey.getModule();
+                                bundle.expired =
+                                    module == null || // already GCed
+                                    control.needsReload(key.getName(),
+                                                        key.getLocale(),
+                                                        key.getFormat(),
+                                                        getLoaderForControl(module),
+                                                        bundle,
+                                                        key.loadTime);
                             } catch (Exception e) {
                                 cacheKey.setCause(e);
                             }
@@ -2185,7 +2088,7 @@
                                                    Control control) {
         setExpirationTime(cacheKey, control);
         if (cacheKey.expirationTime != Control.TTL_DONT_CACHE) {
-            CacheKey key = (CacheKey) cacheKey.clone();
+            CacheKey key = new CacheKey(cacheKey);
             BundleReference bundleRef = new BundleReference(bundle, referenceQueue, key);
             bundle.cacheKey = key;
 
@@ -2231,7 +2134,7 @@
 
     /**
      * Removes all resource bundles from the cache that have been loaded
-     * by the caller's module using the caller's class loader.
+     * by the caller's module.
      *
      * @since 1.6
      * @see ResourceBundle.Control#getTimeToLive(String,Locale)
@@ -2239,47 +2142,29 @@
     @CallerSensitive
     public static final void clearCache() {
         Class<?> caller = Reflection.getCallerClass();
-        clearCache(getLoader(caller), caller.getModule());
+        cacheList.keySet().removeIf(
+            key -> key.getCallerModule() == caller.getModule()
+        );
     }
 
     /**
      * Removes all resource bundles from the cache that have been loaded
-     * by the caller's module using the given class loader.
+     * by the given class loader.
      *
      * @param loader the class loader
      * @exception NullPointerException if <code>loader</code> is null
      * @since 1.6
      * @see ResourceBundle.Control#getTimeToLive(String,Locale)
      */
-    @CallerSensitive
     public static final void clearCache(ClassLoader loader) {
         Objects.requireNonNull(loader);
-        clearCache(loader, Reflection.getCallerClass().getModule());
-    }
-
-    /**
-     * Removes all resource bundles from the cache that have been loaded by the
-     * given {@code module}.
-     *
-     * @param module the module
-     * @throws NullPointerException
-     *         if {@code module} is {@code null}
-     * @throws SecurityException
-     *         if the caller doesn't have the permission to
-     *         {@linkplain Module#getClassLoader() get the class loader}
-     *         of the given {@code module}
-     * @since 9
-     * @see ResourceBundle.Control#getTimeToLive(String,Locale)
-     */
-    public static final void clearCache(Module module) {
-        clearCache(module.getClassLoader(), module);
-    }
-
-    private static void clearCache(ClassLoader loader, Module module) {
-        Set<CacheKey> set = cacheList.keySet();
-        set.stream()
-           .filter((key) -> (key.getLoader() == loader && key.getModule() == module))
-           .forEach(set::remove);
+        cacheList.keySet().removeIf(
+            key -> {
+                Module m;
+                return (m = key.getModule()) != null &&
+                       getLoader(m) == loader;
+            }
+        );
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinWorkerThread.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinWorkerThread.java	Sat Jan 21 03:53:21 2017 +0000
@@ -185,7 +185,14 @@
     static final class InnocuousForkJoinWorkerThread extends ForkJoinWorkerThread {
         /** The ThreadGroup for all InnocuousForkJoinWorkerThreads */
         private static final ThreadGroup innocuousThreadGroup =
-            ThreadLocalRandom.createThreadGroup("InnocuousForkJoinWorkerThreadGroup");
+                java.security.AccessController.doPrivileged(
+                    new java.security.PrivilegedAction<>() {
+                        public ThreadGroup run() {
+                            ThreadGroup group = Thread.currentThread().getThreadGroup();
+                            for (ThreadGroup p; (p = group.getParent()) != null; )
+                                group = p;
+                            return new ThreadGroup(group, "InnocuousForkJoinWorkerThreadGroup");
+                        }});
 
         /** An AccessControlContext supporting no privileges */
         private static final AccessControlContext INNOCUOUS_ACC =
@@ -215,6 +222,5 @@
         public void setContextClassLoader(ClassLoader cl) {
             throw new SecurityException("setContextClassLoader");
         }
-
     }
 }
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java	Sat Jan 21 03:53:21 2017 +0000
@@ -985,34 +985,6 @@
         U.putObjectRelease(thread, INHERITEDACCESSCONTROLCONTEXT, acc);
     }
 
-    /**
-     * Returns a new group with the system ThreadGroup (the
-     * topmost, parent-less group) as parent.  Uses Unsafe to
-     * traverse Thread.group and ThreadGroup.parent fields.
-     */
-    static final ThreadGroup createThreadGroup(String name) {
-        if (name == null)
-            throw new NullPointerException();
-        try {
-            long tg = U.objectFieldOffset
-                (Thread.class.getDeclaredField("group"));
-            long gp = U.objectFieldOffset
-                (ThreadGroup.class.getDeclaredField("parent"));
-            ThreadGroup group = (ThreadGroup)
-                U.getObject(Thread.currentThread(), tg);
-            while (group != null) {
-                ThreadGroup parent = (ThreadGroup)U.getObject(group, gp);
-                if (parent == null)
-                    return new ThreadGroup(group, name);
-                group = parent;
-            }
-        } catch (ReflectiveOperationException e) {
-            throw new Error(e);
-        }
-        // fall through if null as cannot-happen safeguard
-        throw new Error("Cannot create ThreadGroup");
-    }
-
     // Serialization support
 
     private static final long serialVersionUID = -5851777807851030925L;
@@ -1087,17 +1059,17 @@
     static {
         try {
             SEED = U.objectFieldOffset
-                (Thread.class.getDeclaredField("threadLocalRandomSeed"));
+                    (Thread.class.getDeclaredField("threadLocalRandomSeed"));
             PROBE = U.objectFieldOffset
-                (Thread.class.getDeclaredField("threadLocalRandomProbe"));
+                    (Thread.class.getDeclaredField("threadLocalRandomProbe"));
             SECONDARY = U.objectFieldOffset
-                (Thread.class.getDeclaredField("threadLocalRandomSecondarySeed"));
+                    (Thread.class.getDeclaredField("threadLocalRandomSecondarySeed"));
             THREADLOCALS = U.objectFieldOffset
-                (Thread.class.getDeclaredField("threadLocals"));
+                    (Thread.class.getDeclaredField("threadLocals"));
             INHERITABLETHREADLOCALS = U.objectFieldOffset
-                (Thread.class.getDeclaredField("inheritableThreadLocals"));
+                    (Thread.class.getDeclaredField("inheritableThreadLocals"));
             INHERITEDACCESSCONTROLCONTEXT = U.objectFieldOffset
-                (Thread.class.getDeclaredField("inheritedAccessControlContext"));
+                    (Thread.class.getDeclaredField("inheritedAccessControlContext"));
         } catch (ReflectiveOperationException e) {
             throw new Error(e);
         }
@@ -1123,7 +1095,7 @@
     // at end of <clinit> to survive static initialization circularity
     static {
         if (java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction<Boolean>() {
+            new java.security.PrivilegedAction<>() {
                 public Boolean run() {
                     return Boolean.getBoolean("java.util.secureRandomSeed");
                 }})) {
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java	Sat Jan 21 03:53:21 2017 +0000
@@ -40,6 +40,7 @@
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.util.Objects;
 import java.util.function.IntBinaryOperator;
 import java.util.function.IntUnaryOperator;
 import jdk.internal.misc.Unsafe;
@@ -411,7 +412,17 @@
             if (!Modifier.isVolatile(modifiers))
                 throw new IllegalArgumentException("Must be volatile type");
 
-            this.cclass = (Modifier.isProtected(modifiers)) ? caller : tclass;
+            // Access to protected field members is restricted to receivers only
+            // of the accessing class, or one of its subclasses, and the
+            // accessing class must in turn be a subclass (or package sibling)
+            // of the protected member's defining class.
+            // If the updater refers to a protected field of a declaring class
+            // outside the current package, the receiver argument will be
+            // narrowed to the type of the accessing class.
+            this.cclass = (Modifier.isProtected(modifiers) &&
+                           tclass.isAssignableFrom(caller) &&
+                           !isSamePackage(tclass, caller))
+                          ? caller : tclass;
             this.tclass = tclass;
             this.offset = U.objectFieldOffset(field);
         }
@@ -433,6 +444,15 @@
         }
 
         /**
+         * Returns true if the two classes have the same class loader and
+         * package qualifier
+         */
+        private static boolean isSamePackage(Class<?> class1, Class<?> class2) {
+            return class1.getClassLoader() == class2.getClassLoader()
+                   && Objects.equals(class1.getPackageName(), class2.getPackageName());
+        }
+
+        /**
          * Checks that target argument is instance of cclass.  On
          * failure, throws cause.
          */
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java	Sat Jan 21 03:53:21 2017 +0000
@@ -40,6 +40,7 @@
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.util.Objects;
 import java.util.function.LongBinaryOperator;
 import java.util.function.LongUnaryOperator;
 import jdk.internal.misc.Unsafe;
@@ -409,7 +410,17 @@
             if (!Modifier.isVolatile(modifiers))
                 throw new IllegalArgumentException("Must be volatile type");
 
-            this.cclass = (Modifier.isProtected(modifiers)) ? caller : tclass;
+            // Access to protected field members is restricted to receivers only
+            // of the accessing class, or one of its subclasses, and the
+            // accessing class must in turn be a subclass (or package sibling)
+            // of the protected member's defining class.
+            // If the updater refers to a protected field of a declaring class
+            // outside the current package, the receiver argument will be
+            // narrowed to the type of the accessing class.
+            this.cclass = (Modifier.isProtected(modifiers) &&
+                           tclass.isAssignableFrom(caller) &&
+                           !isSamePackage(tclass, caller))
+                          ? caller : tclass;
             this.tclass = tclass;
             this.offset = U.objectFieldOffset(field);
         }
@@ -540,7 +551,17 @@
             if (!Modifier.isVolatile(modifiers))
                 throw new IllegalArgumentException("Must be volatile type");
 
-            this.cclass = (Modifier.isProtected(modifiers)) ? caller : tclass;
+            // Access to protected field members is restricted to receivers only
+            // of the accessing class, or one of its subclasses, and the
+            // accessing class must in turn be a subclass (or package sibling)
+            // of the protected member's defining class.
+            // If the updater refers to a protected field of a declaring class
+            // outside the current package, the receiver argument will be
+            // narrowed to the type of the accessing class.
+            this.cclass = (Modifier.isProtected(modifiers) &&
+                           tclass.isAssignableFrom(caller) &&
+                           !isSamePackage(tclass, caller))
+                          ? caller : tclass;
             this.tclass = tclass;
             this.offset = U.objectFieldOffset(field);
         }
@@ -621,4 +642,13 @@
         } while (acl != null);
         return false;
     }
+
+    /**
+     * Returns true if the two classes have the same class loader and
+     * package qualifier
+     */
+    static boolean isSamePackage(Class<?> class1, Class<?> class2) {
+        return class1.getClassLoader() == class2.getClassLoader()
+               && Objects.equals(class1.getPackageName(), class2.getPackageName());
+    }
 }
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Sat Jan 21 03:53:21 2017 +0000
@@ -40,6 +40,7 @@
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.util.Objects;
 import java.util.function.BinaryOperator;
 import java.util.function.UnaryOperator;
 import jdk.internal.misc.Unsafe;
@@ -351,7 +352,17 @@
             if (!Modifier.isVolatile(modifiers))
                 throw new IllegalArgumentException("Must be volatile type");
 
-            this.cclass = (Modifier.isProtected(modifiers)) ? caller : tclass;
+            // Access to protected field members is restricted to receivers only
+            // of the accessing class, or one of its subclasses, and the
+            // accessing class must in turn be a subclass (or package sibling)
+            // of the protected member's defining class.
+            // If the updater refers to a protected field of a declaring class
+            // outside the current package, the receiver argument will be
+            // narrowed to the type of the accessing class.
+            this.cclass = (Modifier.isProtected(modifiers) &&
+                           tclass.isAssignableFrom(caller) &&
+                           !isSamePackage(tclass, caller))
+                          ? caller : tclass;
             this.tclass = tclass;
             this.vclass = vclass;
             this.offset = U.objectFieldOffset(field);
@@ -374,6 +385,15 @@
         }
 
         /**
+         * Returns true if the two classes have the same class loader and
+         * package qualifier
+         */
+        private static boolean isSamePackage(Class<?> class1, Class<?> class2) {
+            return class1.getClassLoader() == class2.getClassLoader()
+                   && Objects.equals(class1.getPackageName(), class2.getPackageName());
+        }
+
+        /**
          * Checks that target argument is instance of cclass.  On
          * failure, throws cause.
          */
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java	Sat Jan 21 03:53:21 2017 +0000
@@ -41,7 +41,6 @@
 import java.util.concurrent.ThreadLocalRandom;
 import java.util.function.DoubleBinaryOperator;
 import java.util.function.LongBinaryOperator;
-import jdk.internal.misc.Unsafe;
 
 /**
  * A package-local class holding common representation and mechanics
@@ -191,7 +190,7 @@
      * Duplicated from ThreadLocalRandom because of packaging restrictions.
      */
     static final int getProbe() {
-        return U.getInt(Thread.currentThread(), PROBE);
+        return (int) THREAD_PROBE.get(Thread.currentThread());
     }
 
     /**
@@ -203,7 +202,7 @@
         probe ^= probe << 13;   // xorshift
         probe ^= probe >>> 17;
         probe ^= probe << 5;
-        U.putInt(Thread.currentThread(), PROBE, probe);
+        THREAD_PROBE.set(Thread.currentThread(), probe);
         return probe;
     }
 
@@ -373,18 +372,28 @@
         }
     }
 
-    // Unsafe and VarHandle mechanics
-    private static final Unsafe U = Unsafe.getUnsafe();
+    // VarHandle mechanics
     private static final VarHandle BASE;
     private static final VarHandle CELLSBUSY;
-    private static final long PROBE;
+    private static final VarHandle THREAD_PROBE;
     static {
         try {
             MethodHandles.Lookup l = MethodHandles.lookup();
-            BASE = l.findVarHandle(Striped64.class, "base", long.class);
-            CELLSBUSY = l.findVarHandle(Striped64.class, "cellsBusy", int.class);
-            PROBE = U.objectFieldOffset
-                (Thread.class.getDeclaredField("threadLocalRandomProbe"));
+            BASE = l.findVarHandle(Striped64.class,
+                    "base", long.class);
+            CELLSBUSY = l.findVarHandle(Striped64.class,
+                    "cellsBusy", int.class);
+            l = java.security.AccessController.doPrivileged(
+                    new java.security.PrivilegedAction<>() {
+                        public MethodHandles.Lookup run() {
+                            try {
+                                return MethodHandles.privateLookupIn(Thread.class, MethodHandles.lookup());
+                            } catch (ReflectiveOperationException e) {
+                                throw new Error(e);
+                            }
+                        }});
+            THREAD_PROBE = l.findVarHandle(Thread.class,
+                    "threadLocalRandomProbe", int.class);
         } catch (ReflectiveOperationException e) {
             throw new Error(e);
         }
--- a/jdk/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java	Sat Jan 21 03:53:21 2017 +0000
@@ -425,11 +425,11 @@
     static {
         try {
             PARKBLOCKER = U.objectFieldOffset
-                (Thread.class.getDeclaredField("parkBlocker"));
+                    (Thread.class.getDeclaredField("parkBlocker"));
             SECONDARY = U.objectFieldOffset
-                (Thread.class.getDeclaredField("threadLocalRandomSecondarySeed"));
+                    (Thread.class.getDeclaredField("threadLocalRandomSecondarySeed"));
             TID = U.objectFieldOffset
-                (Thread.class.getDeclaredField("tid"));
+                    (Thread.class.getDeclaredField("tid"));
 
         } catch (ReflectiveOperationException e) {
             throw new Error(e);
--- a/jdk/src/java.base/share/classes/javax/net/ssl/HandshakeCompletedEvent.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/HandshakeCompletedEvent.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -120,6 +120,9 @@
      * Note: This method can be used only when using certificate-based
      * cipher suites; using it with non-certificate-based cipher suites,
      * such as Kerberos, will throw an SSLPeerUnverifiedException.
+     * <P>
+     * Note: The returned value may not be a valid certificate chain
+     * and should not be relied on for trust decisions.
      *
      * @return an ordered array of the peer certificates,
      *          with the peer's own certificate first followed by
@@ -140,6 +143,9 @@
      * Note: This method can be used only when using certificate-based
      * cipher suites; using it with non-certificate-based cipher suites,
      * such as Kerberos, will throw an SSLPeerUnverifiedException.
+     * <P>
+     * Note: The returned value may not be a valid certificate chain
+     * and should not be relied on for trust decisions.
      *
      * <p><em>Note: this method exists for compatibility with previous
      * releases. New applications should use
--- a/jdk/src/java.base/share/classes/javax/net/ssl/HttpsURLConnection.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/HttpsURLConnection.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -104,6 +104,9 @@
      * Note: This method can be used only when using certificate-based
      * cipher suites; using it with non-certificate-based cipher suites,
      * such as Kerberos, will throw an SSLPeerUnverifiedException.
+     * <P>
+     * Note: The returned value may not be a valid certificate chain
+     * and should not be relied on for trust decisions.
      *
      * @return an ordered array of server certificates,
      *          with the peer's own certificate first followed by
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLSession.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLSession.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -219,6 +219,9 @@
      * Note: This method can be used only when using certificate-based
      * cipher suites; using it with non-certificate-based cipher suites,
      * such as Kerberos, will throw an SSLPeerUnverifiedException.
+     * <P>
+     * Note: The returned value may not be a valid certificate chain
+     * and should not be relied on for trust decisions.
      *
      * @return an ordered array of peer certificates,
      *          with the peer's own certificate first followed by any
@@ -259,6 +262,9 @@
      * Note: This method can be used only when using certificate-based
      * cipher suites; using it with non-certificate-based cipher suites,
      * such as Kerberos, will throw an SSLPeerUnverifiedException.
+     * <P>
+     * Note: The returned value may not be a valid certificate chain
+     * and should not be relied on for trust decisions.
      *
      * <p><em>Note: this method exists for compatibility with previous
      * releases. New applications should use
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java	Sat Jan 21 03:53:21 2017 +0000
@@ -38,6 +38,7 @@
 import java.net.URLConnection;
 import java.net.URLStreamHandler;
 import java.net.URLStreamHandlerFactory;
+import java.security.AccessControlContext;
 import java.security.AccessControlException;
 import java.security.AccessController;
 import java.security.CodeSigner;
@@ -83,6 +84,7 @@
     private static final String JAVA_VERSION;
     private static final boolean DEBUG;
     private static final boolean DISABLE_JAR_CHECKING;
+    private static final boolean DISABLE_ACC_CHECKING;
 
     static {
         Properties props = GetPropertyAction.privilegedGetProperties();
@@ -90,6 +92,9 @@
         DEBUG = (props.getProperty("sun.misc.URLClassPath.debug") != null);
         String p = props.getProperty("sun.misc.URLClassPath.disableJarChecking");
         DISABLE_JAR_CHECKING = p != null ? p.equals("true") || p.equals("") : false;
+
+        p = props.getProperty("jdk.net.URLClassPath.disableRestrictedPermissions");
+        DISABLE_ACC_CHECKING = p != null ? p.equals("true") || p.equals("") : false;
     }
 
     /* The original search path of URLs. */
@@ -110,6 +115,11 @@
     /* Whether this URLClassLoader has been closed yet */
     private boolean closed = false;
 
+    /* The context to be used when loading classes and resources.  If non-null
+     * this is the context that was captured during the creation of the
+     * URLClassLoader. null implies no additional security restrictions. */
+    private final AccessControlContext acc;
+
     /**
      * Creates a new URLClassPath for the given URLs. The URLs will be
      * searched in the order specified for classes and resources. A URL
@@ -119,8 +129,12 @@
      * @param urls the directory and JAR file URLs to search for classes
      *        and resources
      * @param factory the URLStreamHandlerFactory to use when creating new URLs
+     * @param acc the context to be used when loading classes and resources, may
+     *            be null
      */
-    public URLClassPath(URL[] urls, URLStreamHandlerFactory factory) {
+    public URLClassPath(URL[] urls,
+                        URLStreamHandlerFactory factory,
+                        AccessControlContext acc) {
         for (int i = 0; i < urls.length; i++) {
             path.add(urls[i]);
         }
@@ -128,10 +142,22 @@
         if (factory != null) {
             jarHandler = factory.createURLStreamHandler("jar");
         }
+        if (DISABLE_ACC_CHECKING)
+            this.acc = null;
+        else
+            this.acc = acc;
     }
 
+    /**
+     * Constructs a URLClassPath with no additional security restrictions.
+     * Used by code that implements the class path.
+     */
     public URLClassPath(URL[] urls) {
-        this(urls, null);
+        this(urls, null, null);
+    }
+
+    public URLClassPath(URL[] urls, AccessControlContext acc) {
+        this(urls, null, acc);
     }
 
     public synchronized List<IOException> closeLoaders() {
@@ -356,6 +382,14 @@
             } catch (IOException e) {
                 // Silently ignore for now...
                 continue;
+            } catch (SecurityException se) {
+                // Always silently ignore. The context, if there is one, that
+                // this URLClassPath was given during construction will never
+                // have permission to access the URL.
+                if (DEBUG) {
+                    System.err.println("Failed to access " + url + ", " + se );
+                }
+                continue;
             }
             // Finally, add the Loader to the search path.
             loaders.add(loader);
@@ -378,7 +412,7 @@
                             && file != null && (file.indexOf("!/") == file.length() - 2)) {
                         // extract the nested URL
                         URL nestedUrl = new URL(file.substring(0, file.length() - 2));
-                        return new JarLoader(nestedUrl, jarHandler, lmap);
+                        return new JarLoader(nestedUrl, jarHandler, lmap, acc);
                     } else if (file != null && file.endsWith("/")) {
                         if ("file".equals(protocol)) {
                             return new FileLoader(url);
@@ -386,10 +420,10 @@
                             return new Loader(url);
                         }
                     } else {
-                        return new JarLoader(url, jarHandler, lmap);
+                        return new JarLoader(url, jarHandler, lmap, acc);
                     }
                 }
-            });
+            }, acc);
         } catch (java.security.PrivilegedActionException pae) {
             throw (IOException)pae.getException();
         }
@@ -585,10 +619,11 @@
      */
     static class JarLoader extends Loader {
         private JarFile jar;
-        private URL csu;
+        private final URL csu;
         private JarIndex index;
         private URLStreamHandler handler;
-        private HashMap<String, Loader> lmap;
+        private final HashMap<String, Loader> lmap;
+        private final AccessControlContext acc;
         private boolean closed = false;
         private static final JavaUtilZipFileAccess zipAccess =
                 SharedSecrets.getJavaUtilZipFileAccess();
@@ -598,13 +633,15 @@
          * a JAR file.
          */
         JarLoader(URL url, URLStreamHandler jarHandler,
-                  HashMap<String, Loader> loaderMap)
+                  HashMap<String, Loader> loaderMap,
+                  AccessControlContext acc)
             throws IOException
         {
             super(new URL("jar", "", -1, url + "!/", jarHandler));
             csu = url;
             handler = jarHandler;
             lmap = loaderMap;
+            this.acc = acc;
 
             ensureOpen();
         }
@@ -663,8 +700,7 @@
                                 }
                                 return null;
                             }
-                        }
-                    );
+                        }, acc);
                 } catch (java.security.PrivilegedActionException pae) {
                     throw (IOException)pae.getException();
                 }
@@ -859,9 +895,9 @@
                                 new PrivilegedExceptionAction<>() {
                                     public JarLoader run() throws IOException {
                                         return new JarLoader(url, handler,
-                                            lmap);
+                                            lmap, acc);
                                     }
-                                });
+                                }, acc);
 
                             /* this newly opened jar file has its own index,
                              * merge it into the parent's index, taking into
--- a/jdk/src/java.base/share/classes/jdk/internal/util/jar/JarIndex.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/util/jar/JarIndex.java	Sat Jan 21 03:53:21 2017 +0000
@@ -29,6 +29,7 @@
 import java.util.*;
 import java.util.jar.*;
 import java.util.zip.*;
+import static sun.security.action.GetPropertyAction.privilegedGetProperty;
 
 /**
  * This class is used to maintain mappings from packages, classes
@@ -72,7 +73,7 @@
      * be added to the index. Otherwise, just the directory names are added.
      */
     private static final boolean metaInfFilenames =
-        "true".equals(System.getProperty("sun.misc.JarIndex.metaInfFilenames"));
+        "true".equals(privilegedGetProperty("sun.misc.JarIndex.metaInfFilenames"));
 
     /**
      * Constructs a new, empty jar index.
--- a/jdk/src/java.base/share/classes/module-info.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/module-info.java	Sat Jan 21 03:53:21 2017 +0000
@@ -249,7 +249,6 @@
         jdk.crypto.token;
     exports sun.security.jca to
         java.smartcardio,
-        java.xml.crypto,
         jdk.crypto.ec,
         jdk.crypto.token,
         jdk.naming.dns;
@@ -279,6 +278,7 @@
         java.security.jgss,
         java.security.sasl,
         java.smartcardio,
+        java.xml.crypto,
         jdk.crypto.ec,
         jdk.crypto.token,
         jdk.jartool,
@@ -290,6 +290,8 @@
         jdk.crypto.token,
         jdk.jartool,
         jdk.security.auth;
+    exports sun.security.validator to
+        jdk.jartool;
     exports sun.text.resources to
         jdk.localedata;
     exports sun.util.cldr to
--- a/jdk/src/java.base/share/classes/sun/reflect/misc/ReflectUtil.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/reflect/misc/ReflectUtil.java	Sat Jan 21 03:53:21 2017 +0000
@@ -96,7 +96,7 @@
 
         final Class<?> declaringClass = m.getDeclaringClass();
 
-        checkPackageAccess(declaringClass);
+        privateCheckPackageAccess(sm, declaringClass);
 
         if (Modifier.isPublic(m.getModifiers()) &&
                 Modifier.isPublic(declaringClass.getModifiers()))
@@ -114,9 +114,27 @@
      * also check the package access on the proxy interfaces.
      */
     public static void checkPackageAccess(Class<?> clazz) {
-        checkPackageAccess(clazz.getName());
+        SecurityManager s = System.getSecurityManager();
+        if (s != null) {
+            privateCheckPackageAccess(s, clazz);
+        }
+    }
+
+    /**
+     * NOTE: should only be called if a SecurityManager is installed
+     */
+    private static void privateCheckPackageAccess(SecurityManager s, Class<?> clazz) {
+        while (clazz.isArray()) {
+            clazz = clazz.getComponentType();
+        }
+
+        String pkg = clazz.getPackageName();
+        if (pkg != null && !pkg.isEmpty()) {
+            s.checkPackageAccess(pkg);
+        }
+
         if (isNonPublicProxyClass(clazz)) {
-            checkProxyPackageAccess(clazz);
+            privateCheckProxyPackageAccess(s, clazz);
         }
     }
 
@@ -195,15 +213,21 @@
     public static void checkProxyPackageAccess(Class<?> clazz) {
         SecurityManager s = System.getSecurityManager();
         if (s != null) {
-            // check proxy interfaces if the given class is a proxy class
-            if (Proxy.isProxyClass(clazz)) {
-                for (Class<?> intf : clazz.getInterfaces()) {
-                    checkPackageAccess(intf);
-                }
+            privateCheckProxyPackageAccess(s, clazz);
+        }
+    }
+
+    /**
+     * NOTE: should only be called if a SecurityManager is installed
+     */
+    private static void privateCheckProxyPackageAccess(SecurityManager s, Class<?> clazz) {
+        // check proxy interfaces if the given class is a proxy class
+        if (Proxy.isProxyClass(clazz)) {
+            for (Class<?> intf : clazz.getInterfaces()) {
+                privateCheckPackageAccess(s, intf);
             }
         }
     }
-
     /**
      * Access check on the interfaces that a proxy class implements and throw
      * {@code SecurityException} if it accesses a restricted package from
@@ -220,7 +244,7 @@
             for (Class<?> intf : interfaces) {
                 ClassLoader cl = intf.getClassLoader();
                 if (needsPackageAccessCheck(ccl, cl)) {
-                    checkPackageAccess(intf);
+                    privateCheckPackageAccess(sm, intf);
                 }
             }
         }
@@ -236,10 +260,11 @@
      * package that bypasses checkPackageAccess.
      */
     public static boolean isNonPublicProxyClass(Class<?> cls) {
-        String name = cls.getName();
-        int i = name.lastIndexOf('.');
-        String pkg = (i != -1) ? name.substring(0, i) : "";
-        return Proxy.isProxyClass(cls) && !pkg.startsWith(PROXY_PACKAGE);
+        if (!Proxy.isProxyClass(cls)) {
+            return false;
+        }
+        String pkg = cls.getPackageName();
+        return pkg == null || !pkg.startsWith(PROXY_PACKAGE);
     }
 
     /**
@@ -255,7 +280,7 @@
         // check if it is a valid proxy instance
         if (proxy == null || !Proxy.isProxyClass(proxy.getClass())) {
             throw new IllegalArgumentException("Not a Proxy instance");
-}
+        }
         if (Modifier.isStatic(method.getModifiers())) {
             throw new IllegalArgumentException("Can't handle static method");
         }
--- a/jdk/src/java.base/share/classes/sun/security/provider/DSA.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/DSA.java	Sat Jan 21 03:53:21 2017 +0000
@@ -322,19 +322,20 @@
         } else {
             // first decode the signature.
             try {
-                DerInputStream in = new DerInputStream(signature, offset,
-                                                       length);
+                // Enforce strict DER checking for signatures
+                DerInputStream in =
+                    new DerInputStream(signature, offset, length, false);
                 DerValue[] values = in.getSequence(2);
 
+                // check number of components in the read sequence
+                // and trailing data
+                if ((values.length != 2) || (in.available() != 0)) {
+                    throw new IOException("Invalid encoding for signature");
+                }
                 r = values[0].getBigInteger();
                 s = values[1].getBigInteger();
-
-                // Check for trailing signature data
-                if (in.available() != 0) {
-                    throw new IOException("Incorrect signature length");
-                }
             } catch (IOException e) {
-                throw new SignatureException("invalid encoding for signature");
+                throw new SignatureException("Invalid encoding for signature", e);
             }
         }
 
@@ -427,13 +428,49 @@
         return t5.mod(q);
     }
 
-    // NOTE: This following impl is defined in FIPS 186-4 AppendixB.2.1.
     protected BigInteger generateK(BigInteger q) {
+        // Implementation defined in FIPS 186-4 AppendixB.2.1.
         SecureRandom random = getSigningRandom();
         byte[] kValue = new byte[(q.bitLength() + 7)/8 + 8];
 
         random.nextBytes(kValue);
-        return new BigInteger(1, kValue).mod(q.subtract(BigInteger.ONE)).add(BigInteger.ONE);
+        BigInteger k = new BigInteger(1, kValue).mod(
+                q.subtract(BigInteger.ONE)).add(BigInteger.ONE);
+
+        // Using an equivalent exponent of fixed length (same as q or 1 bit
+        // less than q) to keep the kG timing relatively constant.
+        //
+        // Note that this is an extra step on top of the approach defined in
+        // FIPS 186-4 AppendixB.2.1 so as to make a fixed length K.
+        k = k.add(q).divide(BigInteger.TWO);
+
+        // An alternative implementation based on FIPS 186-4 AppendixB2.2
+        // with fixed-length K.
+        //
+        // Please keep it here as we may need to switch to it in the future.
+        //
+        // SecureRandom random = getSigningRandom();
+        // byte[] kValue = new byte[(q.bitLength() + 7)/8];
+        // BigInteger d = q.subtract(BigInteger.TWO);
+        // BigInteger k;
+        // do {
+        //     random.nextBytes(kValue);
+        //     BigInteger c = new BigInteger(1, kValue);
+        //     if (c.compareTo(d) <= 0) {
+        //         k = c.add(BigInteger.ONE);
+        //         // Using an equivalent exponent of fixed length to keep
+        //         // the g^k timing relatively constant.
+        //         //
+        //         // Note that this is an extra step on top of the approach
+        //         // defined in FIPS 186-4 AppendixB.2.2 so as to make a
+        //         // fixed length K.
+        //         if (k.bitLength() >= q.bitLength()) {
+        //             break;
+        //         }
+        //     }
+        // } while (true);
+
+        return k;
     }
 
     // Use the application-specified SecureRandom Object if provided.
--- a/jdk/src/java.base/share/classes/sun/security/rsa/RSASignature.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/rsa/RSASignature.java	Sat Jan 21 03:53:21 2017 +0000
@@ -226,9 +226,10 @@
      * Decode the signature data. Verify that the object identifier matches
      * and return the message digest.
      */
-    public static byte[] decodeSignature(ObjectIdentifier oid, byte[] signature)
+    public static byte[] decodeSignature(ObjectIdentifier oid, byte[] sig)
             throws IOException {
-        DerInputStream in = new DerInputStream(signature);
+        // Enforce strict DER checking for signatures
+        DerInputStream in = new DerInputStream(sig, 0, sig.length, false);
         DerValue[] values = in.getSequence(2);
         if ((values.length != 2) || (in.available() != 0)) {
             throw new IOException("SEQUENCE length error");
--- a/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java	Sat Jan 21 03:53:21 2017 +0000
@@ -673,8 +673,11 @@
             } else {
                 // we wanted to resume, but the server refused
                 //
-                // Invalidate the session in case of reusing next time.
-                session.invalidate();
+                // Invalidate the session for initial handshake in case
+                // of reusing next time.
+                if (isInitialHandshake) {
+                    session.invalidate();
+                }
                 session = null;
                 if (!enableNewSession) {
                     throw new SSLException("New session creation is disabled");
--- a/jdk/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -818,6 +818,11 @@
             checker.init(false);
         } catch (CertPathValidatorException cpve) {
             // unlikely to happen
+            if (useDebug) {
+                debug.println(
+                    "Cannot initialize algorithm constraints checker: " + cpve);
+            }
+
             return false;
         }
 
@@ -828,6 +833,11 @@
                 // We don't care about the unresolved critical extensions.
                 checker.check(cert, Collections.<String>emptySet());
             } catch (CertPathValidatorException cpve) {
+                if (useDebug) {
+                    debug.println("Certificate (" + cert +
+                        ") does not conform to algorithm constraints: " + cpve);
+                }
+
                 return false;
             }
         }
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -3522,7 +3522,8 @@
             System.err.flush();
             reply = (new BufferedReader(new InputStreamReader
                                         (System.in))).readLine();
-            if (collator.compare(reply, "") == 0 ||
+            if (reply == null ||
+                collator.compare(reply, "") == 0 ||
                 collator.compare(reply, rb.getString("n")) == 0 ||
                 collator.compare(reply, rb.getString("no")) == 0) {
                 reply = "NO";
--- a/jdk/src/java.base/share/classes/sun/security/util/DerInputBuffer.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/DerInputBuffer.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -147,6 +147,11 @@
         System.arraycopy(buf, pos, bytes, 0, len);
         skip(len);
 
+        // check to make sure no extra leading 0s for DER
+        if (len >= 2 && (bytes[0] == 0) && (bytes[1] >= 0)) {
+            throw new IOException("Invalid encoding: redundant leading 0s");
+        }
+
         if (makePositive) {
             return new BigInteger(1, bytes);
         } else {
--- a/jdk/src/java.base/share/classes/sun/security/util/DerInputStream.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/DerInputStream.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@
      * @param data the buffer from which to create the string (CONSUMED)
      */
     public DerInputStream(byte[] data) throws IOException {
-        init(data, 0, data.length);
+        init(data, 0, data.length, true);
     }
 
     /**
@@ -92,23 +92,48 @@
      *          starting at "offset"
      */
     public DerInputStream(byte[] data, int offset, int len) throws IOException {
-        init(data, offset, len);
+        init(data, offset, len, true);
+    }
+
+    /**
+     * Create a DER input stream from part of a data buffer with
+     * additional arg to indicate whether to allow constructed
+     * indefinite-length encoding.
+     * The buffer is not copied, it is shared.  Accordingly, the
+     * buffer should be treated as read-only.
+     *
+     * @param data the buffer from which to create the string (CONSUMED)
+     * @param offset the first index of <em>data</em> which will
+     *          be read as DER input in the new stream
+     * @param len how long a chunk of the buffer to use,
+     *          starting at "offset"
+     * @param allowIndefiniteLength whether to allow constructed
+     *          indefinite-length encoding
+     */
+    public DerInputStream(byte[] data, int offset, int len,
+        boolean allowIndefiniteLength) throws IOException {
+        init(data, offset, len, allowIndefiniteLength);
     }
 
     /*
      * private helper routine
      */
-    private void init(byte[] data, int offset, int len) throws IOException {
+    private void init(byte[] data, int offset, int len,
+        boolean allowIndefiniteLength) throws IOException {
         if ((offset+2 > data.length) || (offset+len > data.length)) {
             throw new IOException("Encoding bytes too short");
         }
         // check for indefinite length encoding
         if (DerIndefLenConverter.isIndefinite(data[offset+1])) {
-            byte[] inData = new byte[len];
-            System.arraycopy(data, offset, inData, 0, len);
+            if (!allowIndefiniteLength) {
+                throw new IOException("Indefinite length BER encoding found");
+            } else {
+                byte[] inData = new byte[len];
+                System.arraycopy(data, offset, inData, 0, len);
 
-            DerIndefLenConverter derIn = new DerIndefLenConverter();
-            buffer = new DerInputBuffer(derIn.convert(inData));
+                DerIndefLenConverter derIn = new DerIndefLenConverter();
+                buffer = new DerInputBuffer(derIn.convert(inData));
+            }
         } else
             buffer = new DerInputBuffer(data, offset, len);
         buffer.mark(Integer.MAX_VALUE);
@@ -239,15 +264,19 @@
          * representation.
          */
         length--;
-        int validBits = length*8 - buffer.read();
+        int excessBits = buffer.read();
+        if (excessBits < 0) {
+            throw new IOException("Unused bits of bit string invalid");
+        }
+        int validBits = length*8 - excessBits;
         if (validBits < 0) {
-            throw new IOException("valid bits of bit string invalid");
+            throw new IOException("Valid bits of bit string invalid");
         }
 
         byte[] repn = new byte[length];
 
         if ((length != 0) && (buffer.read(repn) != length)) {
-            throw new IOException("short read of DER bit string");
+            throw new IOException("Short read of DER bit string");
         }
 
         return new BitArray(validBits, repn);
@@ -263,7 +292,7 @@
         int length = getDefiniteLength(buffer);
         byte[] retval = new byte[length];
         if ((length != 0) && (buffer.read(retval) != length))
-            throw new IOException("short read of DER octet string");
+            throw new IOException("Short read of DER octet string");
 
         return retval;
     }
@@ -273,7 +302,7 @@
      */
     public void getBytes(byte[] val) throws IOException {
         if ((val.length != 0) && (buffer.read(val) != val.length)) {
-            throw new IOException("short read of DER octet string");
+            throw new IOException("Short read of DER octet string");
         }
     }
 
@@ -357,7 +386,7 @@
         DerInputStream  newstr;
 
         byte lenByte = (byte)buffer.read();
-        int len = getLength((lenByte & 0xff), buffer);
+        int len = getLength(lenByte, buffer);
 
         if (len == -1) {
            // indefinite length encoding found
@@ -403,7 +432,7 @@
         } while (newstr.available() > 0);
 
         if (newstr.available() != 0)
-            throw new IOException("extra data at end of vector");
+            throw new IOException("Extra data at end of vector");
 
         /*
          * Now stick them into the array we're returning.
@@ -494,7 +523,7 @@
         int length = getDefiniteLength(buffer);
         byte[] retval = new byte[length];
         if ((length != 0) && (buffer.read(retval) != length))
-            throw new IOException("short read of DER " +
+            throw new IOException("Short read of DER " +
                                   stringName + " string");
 
         return new String(retval, enc);
@@ -555,7 +584,11 @@
      */
     static int getLength(int lenByte, InputStream in) throws IOException {
         int value, tmp;
+        if (lenByte == -1) {
+            throw new IOException("Short read of DER length");
+        }
 
+        String mdName = "DerInputStream.getLength(): ";
         tmp = lenByte;
         if ((tmp & 0x080) == 0x00) { // short form, 1 byte datum
             value = tmp;
@@ -569,17 +602,23 @@
             if (tmp == 0)
                 return -1;
             if (tmp < 0 || tmp > 4)
-                throw new IOException("DerInputStream.getLength(): lengthTag="
-                    + tmp + ", "
+                throw new IOException(mdName + "lengthTag=" + tmp + ", "
                     + ((tmp < 0) ? "incorrect DER encoding." : "too big."));
 
-            for (value = 0; tmp > 0; tmp --) {
+            value = 0x0ff & in.read();
+            tmp--;
+            if (value == 0) {
+                // DER requires length value be encoded in minimum number of bytes
+                throw new IOException(mdName + "Redundant length bytes found");
+            }
+            while (tmp-- > 0) {
                 value <<= 8;
                 value += 0x0ff & in.read();
             }
             if (value < 0) {
-                throw new IOException("DerInputStream.getLength(): "
-                        + "Invalid length bytes");
+                throw new IOException(mdName + "Invalid length bytes");
+            } else if (value <= 127) {
+                throw new IOException(mdName + "Should use short form for length");
             }
         }
         return value;
--- a/jdk/src/java.base/share/classes/sun/security/util/DerValue.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/DerValue.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -248,7 +248,7 @@
 
         tag = (byte)in.read();
         byte lenByte = (byte)in.read();
-        length = DerInputStream.getLength((lenByte & 0xff), in);
+        length = DerInputStream.getLength(lenByte, in);
         if (length == -1) {  // indefinite length encoding found
             DerInputBuffer inbuf = in.dup();
             int readLen = inbuf.available();
@@ -361,7 +361,7 @@
 
         tag = (byte)in.read();
         byte lenByte = (byte)in.read();
-        length = DerInputStream.getLength((lenByte & 0xff), in);
+        length = DerInputStream.getLength(lenByte, in);
         if (length == -1) { // indefinite length encoding found
             int readLen = in.available();
             int offset = 2;     // for tag and length bytes
--- a/jdk/src/java.base/share/classes/sun/security/util/ObjectIdentifier.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/ObjectIdentifier.java	Sat Jan 21 03:53:21 2017 +0000
@@ -255,7 +255,13 @@
                 + " (tag = " +  type_id + ")"
                 );
 
-        encoding = new byte[in.getDefiniteLength()];
+        int len = in.getDefiniteLength();
+        if (len > in.available()) {
+            throw new IOException("ObjectIdentifier() -- length exceeds" +
+                    "data available.  Length: " + len + ", Available: " +
+                    in.available());
+        }
+        encoding = new byte[len];
         in.getBytes(encoding);
         check(encoding);
     }
--- a/jdk/src/java.base/share/conf/security/java.security	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/conf/security/java.security	Sat Jan 21 03:53:21 2017 +0000
@@ -298,111 +298,24 @@
 
 #
 # List of comma-separated packages that start with or equal this string
-# will cause a security exception to be thrown when
-# passed to checkPackageAccess unless the
-# corresponding RuntimePermission ("accessClassInPackage."+package) has
-# been granted.
-package.access=sun.,\
-               com.sun.xml.internal.,\
-               com.sun.imageio.,\
-               com.sun.istack.internal.,\
-               com.sun.jmx.,\
-               com.sun.media.sound.,\
-               com.sun.naming.internal.,\
-               com.sun.proxy.,\
-               com.sun.corba.se.,\
-               com.sun.org.apache.bcel.internal.,\
-               com.sun.org.apache.regexp.internal.,\
-               com.sun.org.apache.xerces.internal.,\
-               com.sun.org.apache.xpath.internal.,\
-               com.sun.org.apache.xalan.internal.extensions.,\
-               com.sun.org.apache.xalan.internal.lib.,\
-               com.sun.org.apache.xalan.internal.res.,\
-               com.sun.org.apache.xalan.internal.templates.,\
-               com.sun.org.apache.xalan.internal.utils.,\
-               com.sun.org.apache.xalan.internal.xslt.,\
-               com.sun.org.apache.xalan.internal.xsltc.cmdline.,\
-               com.sun.org.apache.xalan.internal.xsltc.compiler.,\
-               com.sun.org.apache.xalan.internal.xsltc.trax.,\
-               com.sun.org.apache.xalan.internal.xsltc.util.,\
-               com.sun.org.apache.xml.internal.res.,\
-               com.sun.org.apache.xml.internal.security.,\
-               com.sun.org.apache.xml.internal.serializer.dom3.,\
-               com.sun.org.apache.xml.internal.serializer.utils.,\
-               com.sun.org.apache.xml.internal.utils.,\
-               com.sun.org.glassfish.,\
-               com.sun.tools.script.,\
-               com.oracle.xmlns.internal.,\
-               com.oracle.webservices.internal.,\
-               org.jcp.xml.dsig.internal.,\
-               jdk.internal.,\
-               jdk.nashorn.internal.,\
-               jdk.nashorn.tools.,\
-               jdk.tools.jimage.,\
-               com.sun.activation.registries.,\
-               com.sun.java.accessibility.util.internal.,\
-#ifdef windows
-               com.sun.java.accessibility.internal.,\
-#endif
-#ifdef macosx
-               apple.,\
-#endif
+# will cause a security exception to be thrown when passed to the
+# SecurityManager::checkPackageAccess method unless the corresponding
+# RuntimePermission("accessClassInPackage."+package) has been granted.
+#
+package.access=sun.misc.,\
+               sun.reflect.,\
 
 #
 # List of comma-separated packages that start with or equal this string
-# will cause a security exception to be thrown when
-# passed to checkPackageDefinition unless the
-# corresponding RuntimePermission ("defineClassInPackage."+package) has
-# been granted.
+# will cause a security exception to be thrown when passed to the
+# SecurityManager::checkPackageDefinition method unless the corresponding
+# RuntimePermission("defineClassInPackage."+package) has been granted.
 #
-# by default, none of the class loaders supplied with the JDK call
+# By default, none of the class loaders supplied with the JDK call
 # checkPackageDefinition.
 #
-package.definition=sun.,\
-                   com.sun.xml.internal.,\
-                   com.sun.imageio.,\
-                   com.sun.istack.internal.,\
-                   com.sun.jmx.,\
-                   com.sun.media.sound.,\
-                   com.sun.naming.internal.,\
-                   com.sun.proxy.,\
-                   com.sun.corba.se.,\
-                   com.sun.org.apache.bcel.internal.,\
-                   com.sun.org.apache.regexp.internal.,\
-                   com.sun.org.apache.xerces.internal.,\
-                   com.sun.org.apache.xpath.internal.,\
-                   com.sun.org.apache.xalan.internal.extensions.,\
-                   com.sun.org.apache.xalan.internal.lib.,\
-                   com.sun.org.apache.xalan.internal.res.,\
-                   com.sun.org.apache.xalan.internal.templates.,\
-                   com.sun.org.apache.xalan.internal.utils.,\
-                   com.sun.org.apache.xalan.internal.xslt.,\
-                   com.sun.org.apache.xalan.internal.xsltc.cmdline.,\
-                   com.sun.org.apache.xalan.internal.xsltc.compiler.,\
-                   com.sun.org.apache.xalan.internal.xsltc.trax.,\
-                   com.sun.org.apache.xalan.internal.xsltc.util.,\
-                   com.sun.org.apache.xml.internal.res.,\
-                   com.sun.org.apache.xml.internal.security.,\
-                   com.sun.org.apache.xml.internal.serializer.dom3.,\
-                   com.sun.org.apache.xml.internal.serializer.utils.,\
-                   com.sun.org.apache.xml.internal.utils.,\
-                   com.sun.org.glassfish.,\
-                   com.sun.tools.script.,\
-                   com.oracle.xmlns.internal.,\
-                   com.oracle.webservices.internal.,\
-                   org.jcp.xml.dsig.internal.,\
-                   jdk.internal.,\
-                   jdk.nashorn.internal.,\
-                   jdk.nashorn.tools.,\
-                   jdk.tools.jimage.,\
-                   com.sun.activation.registries.,\
-                   com.sun.java.accessibility.util.internal.,\
-#ifdef windows
-                   com.sun.java.accessibility.internal.,\
-#endif
-#ifdef macosx
-                   apple.,\
-#endif
+package.definition=sun.misc.,\
+                   sun.reflect.,\
 
 #
 # Determines whether this properties file can be appended to
@@ -658,6 +571,36 @@
 jdk.certpath.disabledAlgorithms=MD2, MD5, SHA1 jdkCA & denyAfter 2017-01-01, \
     RSA keySize < 1024, DSA keySize < 1024, EC keySize < 224
 
+#
+# RMI Registry Serial Filter
+#
+# The filter pattern uses the same format as jdk.serialFilter.
+# This filter can override the builtin filter if additional types need to be
+# allowed or rejected from the RMI Registry.
+#
+# Note: This property is currently used by the JDK Reference implementation.
+# It is not guaranteed to be examined and used by other implementations.
+#
+#sun.rmi.registry.registryFilter=pattern;pattern
+#
+# RMI Distributed Garbage Collector (DGC) Serial Filter
+#
+# The filter pattern uses the same format as jdk.serialFilter.
+# This filter can override the builtin filter if additional types need to be
+# allowed or rejected from the RMI DGC.
+#
+# Note: This property is currently used by the JDK Reference implementation.
+# It is not guaranteed to be examined and used by other implementations.
+#
+# The builtin DGC filter can approximately be represented as the filter pattern:
+#
+#sun.rmi.transport.dgcFilter=\
+#    java.rmi.server.ObjID;\
+#    java.rmi.server.UID;\
+#    java.rmi.dgc.VMID;\
+#    java.rmi.dgc.Lease;\
+#    maxdepth=5;maxarray=10000
+
 # Algorithm restrictions for signed JAR files
 #
 # In some environments, certain algorithms or key lengths may be undesirable
@@ -720,7 +663,7 @@
 # Note: The algorithm restrictions do not apply to trust anchors or
 # self-signed certificates.
 #
-# Note: This property is currently used by Oracle's JSSE implementation.
+# Note: This property is currently used by the JDK Reference implementation.
 # It is not guaranteed to be examined and used by other implementations.
 #
 # Example:
@@ -740,7 +683,7 @@
 # During SSL/TLS security parameters negotiation, legacy algorithms will
 # not be negotiated unless there are no other candidates.
 #
-# The syntax of the disabled algorithm string is described as this Java
+# The syntax of the legacy algorithms string is described as this Java
 # BNF-style:
 #   LegacyAlgorithms:
 #       " LegacyAlgorithm { , LegacyAlgorithm } "
@@ -776,7 +719,7 @@
 # javax.net.ssl.SSLParameters.setAlgorithmConstraints()),
 # then the algorithm is completely disabled and will not be negotiated.
 #
-# Note: This property is currently used by Oracle's JSSE implementation.
+# Note: This property is currently used by the JDK Reference implementation.
 # It is not guaranteed to be examined and used by other implementations.
 # There is no guarantee the property will continue to exist or be of the
 # same syntax in future releases.
@@ -789,7 +732,8 @@
         DHE_DSS_EXPORT, DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, \
         DH_RSA_EXPORT, RSA_EXPORT, \
         DH_anon, ECDH_anon, \
-        RC4_128, RC4_40, DES_CBC, DES40_CBC
+        RC4_128, RC4_40, DES_CBC, DES40_CBC, \
+        3DES_EDE_CBC
 
 # The pre-defined default finite field Diffie-Hellman ephemeral (DHE)
 # parameters for Transport Layer Security (SSL/TLS/DTLS) processing.
@@ -912,7 +856,7 @@
 #       Constraint {"," Constraint }
 #   Constraint:
 #       AlgConstraint | MaxTransformsConstraint | MaxReferencesConstraint |
-#       ReferenceUriSchemeConstraint | OtherConstraint
+#       ReferenceUriSchemeConstraint | KeySizeConstraint | OtherConstraint
 #   AlgConstraint
 #       "disallowAlg" Uri
 #   MaxTransformsConstraint:
@@ -921,12 +865,16 @@
 #       "maxReferences" Integer
 #   ReferenceUriSchemeConstraint:
 #       "disallowReferenceUriSchemes" String { String }
+#   KeySizeConstraint:
+#       "minKeySize" KeyAlg Integer
 #   OtherConstraint:
 #       "noDuplicateIds" | "noRetrievalMethodLoops"
 #
 # For AlgConstraint, Uri is the algorithm URI String that is not allowed.
 # See the XML Signature Recommendation for more information on algorithm
-# URI Identifiers. If the MaxTransformsConstraint or MaxReferencesConstraint is
+# URI Identifiers. For KeySizeConstraint, KeyAlg is the standard algorithm
+# name of the key type (ex: "RSA"). If the MaxTransformsConstraint,
+# MaxReferencesConstraint or KeySizeConstraint (for the same key type) is
 # specified more than once, only the last entry is enforced.
 #
 # Note: This property is currently used by the JDK Reference implementation. It
@@ -940,6 +888,8 @@
     maxTransforms 5,\
     maxReferences 30,\
     disallowReferenceUriSchemes file http https,\
+    minKeySize RSA 1024,\
+    minKeySize DSA 1024,\
     noDuplicateIds,\
     noRetrievalMethodLoops
 
--- a/jdk/src/java.base/share/lib/security/default.policy	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/share/lib/security/default.policy	Sat Jan 21 03:53:21 2017 +0000
@@ -81,6 +81,8 @@
 };
 
 grant codeBase "jrt:/java.xml.crypto" {
+    permission java.lang.RuntimePermission
+                   "accessClassInPackage.sun.security.util";
     permission java.util.PropertyPermission "*", "read";
     permission java.security.SecurityPermission "putProviderProperty.XMLDSig";
     permission java.security.SecurityPermission
@@ -91,10 +93,20 @@
                    "com.sun.org.apache.xml.internal.security.register";
     permission java.security.SecurityPermission
                    "getProperty.jdk.xml.dsig.secureValidationPolicy";
+    permission java.lang.RuntimePermission
+                   "accessClassInPackage.com.sun.org.apache.xml.internal.*";
+    permission java.lang.RuntimePermission
+                   "accessClassInPackage.com.sun.org.apache.xpath.internal";
+    permission java.lang.RuntimePermission
+                   "accessClassInPackage.com.sun.org.apache.xpath.internal.*";
 };
 
 grant codeBase "jrt:/java.xml.ws" {
     permission java.lang.RuntimePermission
+                   "accessClassInPackage.com.sun.org.apache.xml.internal.resolver";
+    permission java.lang.RuntimePermission
+                   "accessClassInPackage.com.sun.org.apache.xml.internal.resolver.tools";
+    permission java.lang.RuntimePermission
                    "accessClassInPackage.com.sun.xml.internal.*";
     permission java.lang.RuntimePermission
                    "accessClassInPackage.com.sun.istack.internal";
@@ -186,3 +198,10 @@
     permission java.util.PropertyPermission "os.name", "read";
 };
 
+grant codeBase "jrt:/jdk.accessibility" {
+    permission java.lang.RuntimePermission "accessClassInPackage.sun.awt";
+};
+
+grant codeBase "jrt:/jdk.desktop" {
+    permission java.lang.RuntimePermission "accessClassInPackage.com.sun.awt";
+};
--- a/jdk/src/java.base/unix/native/libnet/SocketOutputStream.c	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/unix/native/libnet/SocketOutputStream.c	Sat Jan 21 03:53:21 2017 +0000
@@ -98,27 +98,31 @@
         int llen = chunkLen;
         (*env)->GetByteArrayRegion(env, data, off, chunkLen, (jbyte *)bufP);
 
-        while(llen > 0) {
-            int n = NET_Send(fd, bufP + loff, llen, 0);
-            if (n > 0) {
-                llen -= n;
-                loff += n;
-                continue;
+        if ((*env)->ExceptionCheck(env)) {
+            break;
+        } else {
+            while(llen > 0) {
+                int n = NET_Send(fd, bufP + loff, llen, 0);
+                if (n > 0) {
+                    llen -= n;
+                    loff += n;
+                    continue;
+                }
+                if (errno == ECONNRESET) {
+                    JNU_ThrowByName(env, "sun/net/ConnectionResetException",
+                        "Connection reset");
+                } else {
+                    JNU_ThrowByNameWithMessageAndLastError
+                        (env, "java/net/SocketException", "Write failed");
+                }
+                if (bufP != BUF) {
+                    free(bufP);
+                }
+                return;
             }
-            if (errno == ECONNRESET) {
-                JNU_ThrowByName(env, "sun/net/ConnectionResetException",
-                    "Connection reset");
-            } else {
-                JNU_ThrowByNameWithMessageAndLastError
-                    (env, "java/net/SocketException", "Write failed");
-            }
-            if (bufP != BUF) {
-                free(bufP);
-            }
-            return;
+            len -= chunkLen;
+            off += chunkLen;
         }
-        len -= chunkLen;
-        off += chunkLen;
     }
 
     if (bufP != BUF) {
--- a/jdk/src/java.base/windows/native/libnet/SocketOutputStream.c	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/windows/native/libnet/SocketOutputStream.c	Sat Jan 21 03:53:21 2017 +0000
@@ -92,66 +92,69 @@
         int retry = 0;
 
         (*env)->GetByteArrayRegion(env, data, off, chunkLen, (jbyte *)bufP);
-
-        while(llen > 0) {
-            int n = send(fd, bufP + loff, llen, 0);
-            if (n > 0) {
-                llen -= n;
-                loff += n;
-                continue;
-            }
-
-            /*
-             * Due to a bug in Windows Sockets (observed on NT and Windows
-             * 2000) it may be necessary to retry the send. The issue is that
-             * on blocking sockets send/WSASend is supposed to block if there
-             * is insufficient buffer space available. If there are a large
-             * number of threads blocked on write due to congestion then it's
-             * possile to hit the NT/2000 bug whereby send returns WSAENOBUFS.
-             * The workaround we use is to retry the send. If we have a
-             * large buffer to send (>2k) then we retry with a maximum of
-             * 2k buffer. If we hit the issue with <=2k buffer then we backoff
-             * for 1 second and retry again. We repeat this up to a reasonable
-             * limit before bailing out and throwing an exception. In load
-             * conditions we've observed that the send will succeed after 2-3
-             * attempts but this depends on network buffers associated with
-             * other sockets draining.
-             */
-            if (WSAGetLastError() == WSAENOBUFS) {
-                if (llen > MAX_BUFFER_LEN) {
-                    buflen = MAX_BUFFER_LEN;
-                    chunkLen = MAX_BUFFER_LEN;
-                    llen = MAX_BUFFER_LEN;
+        if ((*env)->ExceptionCheck(env)) {
+            break;
+        } else {
+            while(llen > 0) {
+                int n = send(fd, bufP + loff, llen, 0);
+                if (n > 0) {
+                    llen -= n;
+                    loff += n;
                     continue;
                 }
-                if (retry >= 30) {
-                    JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
-                        "No buffer space available - exhausted attempts to queue buffer");
-                    if (bufP != BUF) {
-                        free(bufP);
-                    }
-                    return;
-                }
-                Sleep(1000);
-                retry++;
-                continue;
-            }
 
-            /*
-             * Send failed - can be caused by close or write error.
-             */
-            if (WSAGetLastError() == WSAENOTSOCK) {
-                JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
-            } else {
-                NET_ThrowCurrent(env, "socket write error");
+                /*
+                 * Due to a bug in Windows Sockets (observed on NT and Windows
+                 * 2000) it may be necessary to retry the send. The issue is that
+                 * on blocking sockets send/WSASend is supposed to block if there
+                 * is insufficient buffer space available. If there are a large
+                 * number of threads blocked on write due to congestion then it's
+                 * possile to hit the NT/2000 bug whereby send returns WSAENOBUFS.
+                 * The workaround we use is to retry the send. If we have a
+                 * large buffer to send (>2k) then we retry with a maximum of
+                 * 2k buffer. If we hit the issue with <=2k buffer then we backoff
+                 * for 1 second and retry again. We repeat this up to a reasonable
+                 * limit before bailing out and throwing an exception. In load
+                 * conditions we've observed that the send will succeed after 2-3
+                 * attempts but this depends on network buffers associated with
+                 * other sockets draining.
+                 */
+                if (WSAGetLastError() == WSAENOBUFS) {
+                    if (llen > MAX_BUFFER_LEN) {
+                        buflen = MAX_BUFFER_LEN;
+                        chunkLen = MAX_BUFFER_LEN;
+                        llen = MAX_BUFFER_LEN;
+                        continue;
+                    }
+                    if (retry >= 30) {
+                        JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
+                            "No buffer space available - exhausted attempts to queue buffer");
+                        if (bufP != BUF) {
+                            free(bufP);
+                        }
+                        return;
+                    }
+                    Sleep(1000);
+                    retry++;
+                    continue;
+                }
+
+                /*
+                 * Send failed - can be caused by close or write error.
+                 */
+                if (WSAGetLastError() == WSAENOTSOCK) {
+                    JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
+                } else {
+                    NET_ThrowCurrent(env, "socket write error");
+                }
+                if (bufP != BUF) {
+                    free(bufP);
+                }
+                return;
             }
-            if (bufP != BUF) {
-                free(bufP);
-            }
-            return;
+            len -= chunkLen;
+            off += chunkLen;
         }
-        len -= chunkLen;
-        off += chunkLen;
     }
 
     if (bufP != BUF) {
--- a/jdk/src/java.base/windows/native/libnio/ch/WindowsSelectorImpl.c	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.base/windows/native/libnio/ch/WindowsSelectorImpl.c	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 
 #define FD_SETSIZE 1024
 
+#include <limits.h>
 #include <stdlib.h>
 #include <winsock2.h>
 
@@ -75,8 +76,18 @@
         tv = NULL;
     } else {
         tv = &timevalue;
-        tv->tv_sec =  (long)(timeout / 1000);
-        tv->tv_usec = (long)((timeout % 1000) * 1000);
+        jlong sec = timeout / 1000;
+        //
+        // struct timeval members are signed 32-bit integers so the
+        // signed 64-bit jlong needs to be clamped
+        //
+        if (sec > INT_MAX) {
+            tv->tv_sec  = INT_MAX;
+            tv->tv_usec = 0;
+        } else {
+            tv->tv_sec  = (long)sec;
+            tv->tv_usec = (long)((timeout % 1000) * 1000);
+        }
     }
 
     /* Set FD_SET structures required for select */
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java	Sat Jan 21 03:53:21 2017 +0000
@@ -123,7 +123,7 @@
         }
 
         // grab the pointer to the CMenuBar, and retain it in native
-        nativeSetDefaultMenuBar(((CMenuBar)peer).getModel());
+        ((CMenuBar) peer).execute(_AppMenuBarHandler::nativeSetDefaultMenuBar);
     }
 
     void setAboutMenuItemVisible(final boolean present) {
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CCheckboxMenuItem.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CCheckboxMenuItem.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,29 +26,28 @@
 package sun.lwawt.macosx;
 
 import java.awt.CheckboxMenuItem;
-import java.awt.EventQueue;
 import java.awt.event.ItemEvent;
 import java.awt.peer.CheckboxMenuItemPeer;
 
 import sun.awt.SunToolkit;
 
 public class CCheckboxMenuItem extends CMenuItem implements CheckboxMenuItemPeer {
-    boolean fAutoToggle = true;
-    boolean fIsIndeterminate = false;
+    volatile boolean fAutoToggle = true;
+    volatile boolean fIsIndeterminate = false;
 
     private native void nativeSetState(long modelPtr, boolean state);
     private native void nativeSetIsCheckbox(long modelPtr);
 
-    CCheckboxMenuItem(CheckboxMenuItem target) {
+    CCheckboxMenuItem(final CheckboxMenuItem target) {
         super(target);
-        nativeSetIsCheckbox(getModel());
+        execute(this::nativeSetIsCheckbox);
         setState(target.getState());
     }
 
     // MenuItemPeer implementation
     @Override
-    public void setState(boolean state) {
-        nativeSetState(getModel(), state);
+    public void setState(final boolean state) {
+        execute(ptr -> nativeSetState(ptr, state));
     }
 
     public void handleAction(final boolean state) {
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java	Sat Jan 21 03:53:21 2017 +0000
@@ -23,7 +23,6 @@
  * questions.
  */
 
-
 package sun.lwawt.macosx;
 
 /**
@@ -34,6 +33,7 @@
     private static native void nativeCFRelease(final long ptr, final boolean disposeOnAppKitThread);
 
     private final boolean disposeOnAppKitThread;
+    // TODO this pointer should be private and accessed via CFNativeAction class
     protected volatile long ptr;
 
     /**
@@ -70,8 +70,72 @@
         nativeCFRelease(oldPtr, disposeOnAppKitThread); // perform outside of the synchronized block
     }
 
+    /**
+     * The interface which allows to execute some native operations with
+     * assumption that the native pointer will be valid till the end.
+     */
+    public interface CFNativeAction {
+
+        /**
+         * The native operation should be called from this method.
+         *
+         * @param  ptr the pointer to the native data
+         */
+        void run(long ptr);
+    }
+
+    /**
+     * The interface which allows to execute some native operations and get a
+     * result with assumption that the native pointer will be valid till the
+     * end.
+     */
+    interface CFNativeActionGet {
+
+        /**
+         * The native operation should be called from this method.
+         *
+         * @param  ptr the pointer to the native data
+         * @return result of the native operation
+         */
+        long run(long ptr);
+    }
+
+    /**
+     * This is utility method which should be used instead of the direct access
+     * to the {@link #ptr}, because this method guaranteed that the pointer will
+     * not be zero and will be valid till the end of the operation.It is highly
+     * recomended to not use any external lock in action. If the current
+     * {@link #ptr} is {@code 0} then action will be ignored.
+     *
+     * @param  action The native operation
+     */
+    public final synchronized void execute(final CFNativeAction action) {
+        if (ptr != 0) {
+            action.run(ptr);
+        }
+    }
+
+    /**
+     * This is utility method which should be used instead of the direct access
+     * to the {@link #ptr}, because this method guaranteed that the pointer will
+     * not be zero and will be valid till the end of the operation. It is highly
+     * recomended to not use any external lock in action. If the current
+     * {@link #ptr} is {@code 0} then action will be ignored and {@code} is
+     * returned.
+     *
+     * @param  action the native operation
+     * @return result of the native operation, usually the native pointer to
+     *         some other data
+     */
+    final synchronized long executeGet(final CFNativeActionGet action) {
+        if (ptr != 0) {
+            return action.run(ptr);
+        }
+        return 0;
+    }
+
     @Override
-    protected void finalize() throws Throwable {
+    protected final void finalize() throws Throwable {
         dispose();
     }
 }
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenu.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenu.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,9 @@
 
 package sun.lwawt.macosx;
 
-import java.awt.*;
+import java.awt.Menu;
+import java.awt.MenuBar;
+import java.awt.MenuItem;
 import java.awt.peer.MenuItemPeer;
 import java.awt.peer.MenuPeer;
 
@@ -37,7 +39,7 @@
 
     // This way we avoiding invocation of the setters twice
     @Override
-    protected void initialize(MenuItem target) {
+    protected final void initialize(MenuItem target) {
         setLabel(target.getLabel());
         setEnabled(target.isEnabled());
     }
@@ -57,52 +59,50 @@
     }
 
     @Override
-    protected long createModel() {
+    long createModel() {
         CMenuComponent parent = (CMenuComponent)
             LWCToolkit.targetToPeer(getTarget().getParent());
 
-        if (parent instanceof CMenu ||
-            parent instanceof CPopupMenu)
-        {
-            return nativeCreateSubMenu(parent.getModel());
-        } else if (parent instanceof CMenuBar) {
+        if (parent instanceof CMenu) {
+            return parent.executeGet(this::nativeCreateSubMenu);
+        }
+        if (parent instanceof CMenuBar) {
             MenuBar parentContainer = (MenuBar)getTarget().getParent();
             boolean isHelpMenu = parentContainer.getHelpMenu() == getTarget();
             int insertionLocation = ((CMenuBar)parent).getNextInsertionIndex();
-            return nativeCreateMenu(parent.getModel(),
-                                    isHelpMenu, insertionLocation);
-        } else {
-            throw new InternalError("Parent must be CMenu or CMenuBar");
+            return parent.executeGet(ptr -> nativeCreateMenu(ptr, isHelpMenu,
+                                                             insertionLocation));
         }
+        throw new InternalError("Parent must be CMenu or CMenuBar");
     }
 
     @Override
-    public void addItem(MenuItem item) {
+    public final void addItem(MenuItem item) {
         // Nothing to do here -- we added it when we created the
         // menu item's peer.
     }
 
     @Override
-    public void delItem(int index) {
-        nativeDeleteItem(getModel(), index);
+    public final void delItem(final int index) {
+        execute(ptr -> nativeDeleteItem(ptr, index));
     }
 
     @Override
-    public void setLabel(String label) {
-        nativeSetMenuTitle(getModel(), label);
+    public final void setLabel(final String label) {
+        execute(ptr->nativeSetMenuTitle(ptr, label));
         super.setLabel(label);
     }
 
     // Note that addSeparator is never called directly from java.awt.Menu,
     // though it is required in the MenuPeer interface.
     @Override
-    public void addSeparator() {
-        nativeAddSeparator(getModel());
+    public final void addSeparator() {
+        execute(this::nativeAddSeparator);
     }
 
     // Used by ScreenMenuBar to get to the native menu for event handling.
-    public long getNativeMenu() {
-        return nativeGetNSMenu(getModel());
+    public final long getNativeMenu() {
+        return executeGet(this::nativeGetNSMenu);
     }
 
     private native long nativeCreateMenu(long parentMenuPtr,
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuBar.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuBar.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
 
 import sun.awt.AWTAccessor;
 
-public class CMenuBar extends CMenuComponent implements MenuBarPeer {
+public final class CMenuBar extends CMenuComponent implements MenuBarPeer {
 
     private int nextInsertionIndex = -1;
 
@@ -40,14 +40,15 @@
     }
 
     @Override
-    protected long createModel() {
+    long createModel() {
         return nativeCreateMenuBar();
     }
 
     @Override
-    public void addHelpMenu(Menu m) {
-        CMenu cMenu = AWTAccessor.getMenuComponentAccessor().getPeer(m);
-        nativeSetHelpMenu(getModel(), cMenu.getModel());
+    public void addHelpMenu(final Menu m) {
+        final CMenu cMenu = AWTAccessor.getMenuComponentAccessor().getPeer(m);
+        execute(parentPtr -> cMenu.execute(
+                menuPtr -> nativeSetHelpMenu(parentPtr, menuPtr)));
     }
 
     public int getNextInsertionIndex() {
@@ -65,8 +66,8 @@
     }
 
     @Override
-    public void delMenu(int index) {
-        nativeDelMenu(getModel(), index);
+    public void delMenu(final int index) {
+        execute(ptr -> nativeDelMenu(ptr, index));
     }
 
     private native long nativeCreateMenuBar();
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuComponent.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuComponent.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,36 +29,32 @@
 import java.awt.MenuComponent;
 import java.awt.peer.MenuComponentPeer;
 
-public abstract class CMenuComponent implements MenuComponentPeer {
+abstract class CMenuComponent extends CFRetainedResource
+        implements MenuComponentPeer {
+
+    private final MenuComponent target;
 
-    private MenuComponent target;
-    private long modelPtr;
-
-    CMenuComponent(MenuComponent target) {
+    CMenuComponent(final MenuComponent target) {
+        super(0, true);
         this.target = target;
-        this.modelPtr = createModel();
+        setPtr(createModel());
     }
 
-    MenuComponent getTarget() {
+    final MenuComponent getTarget() {
         return target;
     }
 
-    public long getModel() {
-        return modelPtr;
+    abstract long createModel();
+
+    @Override
+    public final void dispose() {
+        super.dispose();
+        LWCToolkit.targetDisposedPeer(target, this);
     }
 
-    protected abstract long createModel();
-
-    public void dispose() {
-        LWCToolkit.targetDisposedPeer(target, this);
-        nativeDispose(modelPtr);
-        target = null;
-    }
-
-    private native void nativeDispose(long modelPtr);
-
     // 1.5 peer method
-    public void setFont(Font f) {
+    @Override
+    public final void setFont(final Font f) {
         // no-op, as we don't currently support menu fonts
         // c.f. radar 4032912
     }
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,16 +25,17 @@
 
 package sun.lwawt.macosx;
 
+import java.awt.MenuItem;
+import java.awt.MenuShortcut;
+import java.awt.event.ActionEvent;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.awt.peer.MenuItemPeer;
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import sun.awt.SunToolkit;
 import sun.lwawt.LWToolkit;
 
-import java.awt.MenuContainer;
-import java.awt.MenuItem;
-import java.awt.MenuShortcut;
-import java.awt.event.*;
-import java.awt.peer.MenuItemPeer;
-import java.util.concurrent.atomic.AtomicBoolean;
-
 public class CMenuItem extends CMenuComponent implements MenuItemPeer {
 
     private final AtomicBoolean enabled = new AtomicBoolean(true);
@@ -58,9 +59,9 @@
     }
 
     @Override
-    protected long createModel() {
+    long createModel() {
         CMenuComponent parent = (CMenuComponent)LWToolkit.targetToPeer(getTarget().getParent());
-        return nativeCreate(parent.getModel(), isSeparator());
+        return parent.executeGet(ptr->nativeCreate(ptr, isSeparator()));
     }
 
     public void setLabel(String label, char keyChar, int keyCode, int modifiers) {
@@ -90,7 +91,12 @@
             keyChar = 0;
         }
 
-        nativeSetLabel(getModel(), label, keyChar, keyCode, keyMask);
+        final String finalLabel = label;
+        final char finalKeyChar = keyChar;
+        final int finalKeyCode = keyCode;
+        final int finalKeyMask = keyMask;
+        execute(ptr -> nativeSetLabel(ptr, finalLabel, finalKeyChar,
+                                      finalKeyCode, finalKeyMask));
     }
 
     @Override
@@ -105,16 +111,16 @@
      * There isn't a need to expose this except in a instanceof because
      * it isn't defined in the peer api.
      */
-    public void setImage(java.awt.Image img) {
+    public final void setImage(final java.awt.Image img) {
         CImage cimg = CImage.getCreator().createFromImage(img);
-        nativeSetImage(getModel(), cimg == null ? 0L : cimg.ptr);
+        execute(ptr -> nativeSetImage(ptr, cimg == null ? 0L : cimg.ptr));
     }
 
     /**
      * New API for tooltips
      */
-    public void setToolTipText(String text) {
-        nativeSetTooltip(getModel(), text);
+    public final void setToolTipText(final String text) {
+        execute(ptr -> nativeSetTooltip(ptr, text));
     }
 
 //    @Override
@@ -138,7 +144,8 @@
             b &= ((CMenuItem) parent).isEnabled();
         }
         if (enabled.compareAndSet(!b, b)) {
-            nativeSetEnabled(getModel(), b);
+            final boolean finalB = b;
+            execute(ptr->nativeSetEnabled(ptr, finalB));
         }
     }
 
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Sat Jan 21 03:53:21 2017 +0000
@@ -449,7 +449,7 @@
         final long nsWindowPtr = getNSWindowPtr();
         CMenuBar mbPeer = (CMenuBar)LWToolkit.targetToPeer(mb);
         if (mbPeer != null) {
-            nativeSetNSWindowMenuBar(nsWindowPtr, mbPeer.getModel());
+            mbPeer.execute(ptr -> nativeSetNSWindowMenuBar(nsWindowPtr, ptr));
         } else {
             nativeSetNSWindowMenuBar(nsWindowPtr, 0);
         }
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPopupMenu.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPopupMenu.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,20 @@
 
 package sun.lwawt.macosx;
 
-import java.awt.*;
+import java.awt.Component;
+import java.awt.Event;
+import java.awt.Point;
+import java.awt.PopupMenu;
 import java.awt.peer.PopupMenuPeer;
 
-import sun.lwawt.LWWindowPeer;
+final class CPopupMenu extends CMenu implements PopupMenuPeer {
 
-public class CPopupMenu extends CMenu implements PopupMenuPeer {
     CPopupMenu(PopupMenu target) {
         super(target);
     }
 
     @Override
-    protected long createModel() {
+    long createModel() {
         return nativeCreatePopupMenu();
     }
 
@@ -50,7 +52,7 @@
             Point loc = origin.getLocationOnScreen();
             e.x += loc.x;
             e.y += loc.y;
-            nativeShowPopupMenu(getModel(), e.x, e.y);
+            execute(ptr -> nativeShowPopupMenu(ptr, e.x, e.y));
         }
     }
 }
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -118,7 +118,10 @@
             }
         }
 
-        return checkAndCreatePopupPeer().getModel();
+        // This method is executed on Appkit, so if ptr is not zero means that,
+        // it is still not deallocated(even if we call NSApp postRunnableEvent)
+        // and sent CFRelease to the native queue
+        return checkAndCreatePopupPeer().ptr;
     }
 
     /**
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenu.m	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenu.m	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
 - (id)initWithPeer:(jobject)peer {
 AWT_ASSERT_APPKIT_THREAD;
     // Create the new NSMenu
-    self = [super initWithPeer:peer asSeparator:[NSNumber numberWithBool:NO]];
+    self = [super initWithPeer:peer asSeparator:NO];
     if (self) {
         fMenu = [NSMenu javaMenuWithTitle:@""];
         [fMenu retain];
@@ -133,14 +133,13 @@
 
 CMenu * createCMenu (jobject cPeerObjGlobal) {
 
-    CMenu *aCMenu = nil;
+    __block CMenu *aCMenu = nil;
+
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
 
-    // We use an array here only to be able to get a return value
-    NSMutableArray *args = [[NSMutableArray alloc] initWithObjects:[NSValue valueWithBytes:&cPeerObjGlobal objCType:@encode(jobject)], nil];
-
-    [ThreadUtilities performOnMainThread:@selector(_create_OnAppKitThread:) on:[CMenu alloc] withObject:args waitUntilDone:YES];
-
-    aCMenu = (CMenu *)[args objectAtIndex: 0];
+        aCMenu = [[CMenu alloc] initWithPeer:cPeerObjGlobal];
+        // the aCMenu is released in CMenuComponent.dispose()
+    }];
 
     if (aCMenu == nil) {
         return 0L;
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuBar.m	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuBar.m	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -383,27 +383,20 @@
 Java_sun_lwawt_macosx_CMenuBar_nativeCreateMenuBar
     (JNIEnv *env, jobject peer)
 {
-    CMenuBar *aCMenuBar = nil;
+    __block CMenuBar *aCMenuBar = nil;
     JNF_COCOA_ENTER(env);
 
     jobject cPeerObjGlobal = (*env)->NewGlobalRef(env, peer);
 
-    // We use an array here only to be able to get a return value
-    NSMutableArray *args = [[NSMutableArray alloc] initWithObjects:[NSValue valueWithBytes:&cPeerObjGlobal objCType:@encode(jobject)], nil];
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
 
-    [ThreadUtilities performOnMainThread:@selector(_create_OnAppKitThread:) on:[CMenuBar alloc] withObject:args waitUntilDone:YES];
-
-    aCMenuBar = (CMenuBar *)[args objectAtIndex: 0];
-
+        aCMenuBar = [[CMenuBar alloc] initWithPeer:cPeerObjGlobal];
+        // the aCMenuBar is released in CMenuComponent.dispose()
+    }];
     if (aCMenuBar == nil) {
         return 0L;
     }
 
-    // [args release];
-
-    // A strange memory managment after that.
-
-
     JNF_COCOA_EXIT(env);
     return ptr_to_jlong(aCMenuBar);
 }
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuComponent.m	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuComponent.m	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,45 +41,11 @@
     return self;
 }
 
--(void) cleanup {
-    // Used by subclasses
-}
-
--(void) disposer {
+- (void)dealloc {
     JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
     JNFDeleteGlobalRef(env, fPeer);
     fPeer = NULL;
 
-    [self cleanup];
-    [self release];
+    [super dealloc];
 }
-
-// The method is used by all subclasses, since the process of the creation
-// is the same. The only exception is the CMenuItem class.
-- (void) _create_OnAppKitThread: (NSMutableArray *)argValue {
-    jobject cPeerObjGlobal = (jobject)[[argValue objectAtIndex: 0] pointerValue];
-    CMenuItem *aCMenuItem = [self initWithPeer:cPeerObjGlobal];
-    [argValue removeAllObjects];
-    [argValue addObject: aCMenuItem];
-}
-
 @end
-
-/*
- * Class:     sun_lwawt_macosx_CMenuComponent
- * Method:    nativeDispose
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL
-Java_sun_lwawt_macosx_CMenuComponent_nativeDispose
-(JNIEnv *env, jobject peer, jlong menuItemObj)
-{
-JNF_COCOA_ENTER(env);
-
-    [ThreadUtilities performOnMainThread:@selector(disposer)
-                                      on:((id)jlong_to_ptr(menuItemObj))
-                              withObject:nil
-                           waitUntilDone:NO];
-
-JNF_COCOA_EXIT(env);
-}
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuItem.h	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuItem.h	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
 }
 
 // Setup
-- (id) initWithPeer:(jobject)peer asSeparator: (NSNumber *) asSeparator;
+- (id) initWithPeer:(jobject)peer asSeparator: (BOOL) asSeparator;
 - (void) setIsCheckbox;
 
 // Events
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuItem.m	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuItem.m	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,11 +39,11 @@
 
 @implementation CMenuItem
 
-- (id) initWithPeer:(jobject)peer asSeparator: (NSNumber *) asSeparator{
+- (id) initWithPeer:(jobject)peer asSeparator: (BOOL) asSeparator{
     AWT_ASSERT_APPKIT_THREAD;
     self = [super initWithPeer:peer];
     if (self) {
-        if ([asSeparator boolValue]) {
+        if (asSeparator) {
             fMenuItem = (NSMenuItem*)[NSMenuItem separatorItem];
             [fMenuItem retain];
         } else {
@@ -204,12 +204,9 @@
     }];
 }
 
-- (void)cleanup {
+- (void)dealloc {
     [fMenuItem setAction:NULL];
     [fMenuItem setTarget:nil];
-}
-
-- (void)dealloc {
     [fMenuItem release];
     fMenuItem = nil;
     
@@ -228,14 +225,6 @@
     fIsCheckbox = YES;
 }
 
-- (void) _createMenuItem_OnAppKitThread: (NSMutableArray *)argValue {
-    jobject cPeerObjGlobal = (jobject)[[argValue objectAtIndex: 0] pointerValue];
-    NSNumber * asSeparator = (NSNumber *)[argValue objectAtIndex: 1];
-    CMenuItem *aCMenuItem = [self initWithPeer: cPeerObjGlobal asSeparator: asSeparator];
-    [argValue removeAllObjects];
-    [argValue addObject: aCMenuItem];
-}
-
 - (NSString *)description {
     return [NSString stringWithFormat:@"CMenuItem[ %@ ]", fMenuItem];
 }
@@ -397,24 +386,18 @@
 (JNIEnv *env, jobject peer, jlong parentCMenuObj, jboolean isSeparator)
 {
     
-    CMenuItem *aCMenuItem = nil;
+    __block CMenuItem *aCMenuItem = nil;
+    BOOL asSeparator = (isSeparator == JNI_TRUE) ? YES: NO;
     CMenu *parentCMenu = (CMenu *)jlong_to_ptr(parentCMenuObj);
     JNF_COCOA_ENTER(env);
     
     jobject cPeerObjGlobal = (*env)->NewGlobalRef(env, peer);
-    
-    NSMutableArray *args = nil;
-    
-    // Create a new item....
-    if (isSeparator == JNI_TRUE) {
-        args = [[NSMutableArray alloc] initWithObjects:[NSValue valueWithBytes:&cPeerObjGlobal objCType:@encode(jobject)], [NSNumber numberWithBool:YES],  nil];
-    } else {
-        args = [[NSMutableArray alloc] initWithObjects:[NSValue valueWithBytes:&cPeerObjGlobal objCType:@encode(jobject)], [NSNumber numberWithBool:NO],  nil];
-    }
-    
-    [ThreadUtilities performOnMainThread:@selector(_createMenuItem_OnAppKitThread:) on:[CMenuItem alloc] withObject:args waitUntilDone:YES];
-    
-    aCMenuItem = (CMenuItem *)[args objectAtIndex: 0];
+
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+        aCMenuItem = [[CMenuItem alloc] initWithPeer: cPeerObjGlobal
+                                         asSeparator: asSeparator];
+        // the CMenuItem is released in CMenuComponent.dispose()
+    }];
     
     if (aCMenuItem == nil) {
         return 0L;
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java	Sat Jan 21 03:53:21 2017 +0000
@@ -735,7 +735,11 @@
                     parse_iCCP_chunk(chunkLength);
                     break;
                 case iTXt_TYPE:
-                    parse_iTXt_chunk(chunkLength);
+                    if (ignoreMetadata) {
+                        stream.skipBytes(chunkLength);
+                    } else {
+                        parse_iTXt_chunk(chunkLength);
+                    }
                     break;
                 case pHYs_TYPE:
                     parse_pHYs_chunk();
@@ -759,7 +763,11 @@
                     parse_tRNS_chunk(chunkLength);
                     break;
                 case zTXt_TYPE:
-                    parse_zTXt_chunk(chunkLength);
+                    if (ignoreMetadata) {
+                        stream.skipBytes(chunkLength);
+                    } else {
+                        parse_zTXt_chunk(chunkLength);
+                    }
                     break;
                 default:
                     // Read an unknown chunk
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -247,7 +247,7 @@
  * @destroy: callback to call when @data is not needed anymore.
  * @replace: whether to replace an existing data with the same key.
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -266,9 +266,9 @@
  * @blob: a blob.
  * @key: key for data to get.
  *
- *
+ * 
  *
- * Return value: (transfer none):
+ * Return value: (transfer none): 
  *
  * Since: 0.9.2
  **/
@@ -284,7 +284,7 @@
  * hb_blob_make_immutable:
  * @blob: a blob.
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -301,7 +301,7 @@
  * hb_blob_is_immutable:
  * @blob: a blob.
  *
- *
+ * 
  *
  * Return value: TODO
  *
@@ -318,7 +318,7 @@
  * hb_blob_get_length:
  * @blob: a blob.
  *
- *
+ * 
  *
  * Return value: the length of blob data in bytes.
  *
@@ -335,9 +335,9 @@
  * @blob: a blob.
  * @length: (out):
  *
- *
+ * 
  *
- * Returns: (transfer none) (array length=length):
+ * Returns: (transfer none) (array length=length): 
  *
  * Since: 0.9.2
  **/
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-json.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-json.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -34,397 +34,397 @@
 
 #line 36 "hb-buffer-deserialize-json.hh"
 static const unsigned char _deserialize_json_trans_keys[] = {
-        0u, 0u, 9u, 123u, 9u, 34u, 97u, 103u, 120u, 121u, 34u, 34u, 9u, 58u, 9u, 57u,
-        48u, 57u, 9u, 125u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u, 48u, 57u,
-        9u, 125u, 9u, 125u, 108u, 108u, 34u, 34u, 9u, 58u, 9u, 57u, 9u, 125u, 9u, 125u,
-        120u, 121u, 34u, 34u, 9u, 58u, 9u, 57u, 48u, 57u, 9u, 125u, 9u, 125u, 34u, 34u,
-        9u, 58u, 9u, 57u, 48u, 57u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u,
+        0u, 0u, 9u, 123u, 9u, 34u, 97u, 103u, 120u, 121u, 34u, 34u, 9u, 58u, 9u, 57u, 
+        48u, 57u, 9u, 125u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u, 48u, 57u, 
+        9u, 125u, 9u, 125u, 108u, 108u, 34u, 34u, 9u, 58u, 9u, 57u, 9u, 125u, 9u, 125u, 
+        120u, 121u, 34u, 34u, 9u, 58u, 9u, 57u, 48u, 57u, 9u, 125u, 9u, 125u, 34u, 34u, 
+        9u, 58u, 9u, 57u, 48u, 57u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u, 
         65u, 122u, 34u, 122u, 9u, 125u, 9u, 125u, 9u, 93u, 9u, 123u, 0u, 0u, 0
 };
 
 static const char _deserialize_json_key_spans[] = {
-        0, 115, 26, 7, 2, 1, 50, 49,
-        10, 117, 117, 117, 1, 50, 49, 10,
-        117, 117, 1, 1, 50, 49, 117, 117,
-        2, 1, 50, 49, 10, 117, 117, 1,
-        50, 49, 10, 117, 117, 1, 50, 49,
+        0, 115, 26, 7, 2, 1, 50, 49, 
+        10, 117, 117, 117, 1, 50, 49, 10, 
+        117, 117, 1, 1, 50, 49, 117, 117, 
+        2, 1, 50, 49, 10, 117, 117, 1, 
+        50, 49, 10, 117, 117, 1, 50, 49, 
         58, 89, 117, 117, 85, 115, 0
 };
 
 static const short _deserialize_json_index_offsets[] = {
-        0, 0, 116, 143, 151, 154, 156, 207,
-        257, 268, 386, 504, 622, 624, 675, 725,
-        736, 854, 972, 974, 976, 1027, 1077, 1195,
-        1313, 1316, 1318, 1369, 1419, 1430, 1548, 1666,
-        1668, 1719, 1769, 1780, 1898, 2016, 2018, 2069,
+        0, 0, 116, 143, 151, 154, 156, 207, 
+        257, 268, 386, 504, 622, 624, 675, 725, 
+        736, 854, 972, 974, 976, 1027, 1077, 1195, 
+        1313, 1316, 1318, 1369, 1419, 1430, 1548, 1666, 
+        1668, 1719, 1769, 1780, 1898, 2016, 2018, 2069, 
         2119, 2178, 2268, 2386, 2504, 2590, 2706
 };
 
 static const char _deserialize_json_indicies[] = {
-        0, 0, 0, 0, 0, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        0, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 2, 1, 3, 3, 3,
-        3, 3, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 3, 1, 4, 1,
-        5, 1, 6, 7, 1, 1, 8, 1,
-        9, 10, 1, 11, 1, 11, 11, 11,
-        11, 11, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 11, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 12, 1,
-        12, 12, 12, 12, 12, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 12,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 13, 1, 1, 14,
-        15, 15, 15, 15, 15, 15, 15, 15,
-        15, 1, 16, 17, 17, 17, 17, 17,
-        17, 17, 17, 17, 1, 18, 18, 18,
-        18, 18, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 18, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        19, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 20, 1, 21, 21, 21, 21, 21,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 21, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 3, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 22,
-        1, 18, 18, 18, 18, 18, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        18, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 19, 1, 1, 1,
-        17, 17, 17, 17, 17, 17, 17, 17,
-        17, 17, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 20, 1, 23,
-        1, 23, 23, 23, 23, 23, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        23, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 24, 1, 24, 24, 24, 24,
-        24, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 24, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        25, 1, 1, 26, 27, 27, 27, 27,
-        27, 27, 27, 27, 27, 1, 28, 29,
-        29, 29, 29, 29, 29, 29, 29, 29,
-        1, 30, 30, 30, 30, 30, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        30, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 31, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 32, 1, 30,
-        30, 30, 30, 30, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 30, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 31, 1, 1, 1, 29, 29,
-        29, 29, 29, 29, 29, 29, 29, 29,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 32, 1, 33, 1, 34,
-        1, 34, 34, 34, 34, 34, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        34, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 35, 1, 35, 35, 35, 35,
-        35, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 35, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 36, 37, 37, 37, 37,
-        37, 37, 37, 37, 37, 1, 38, 38,
-        38, 38, 38, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 38, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 39, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 40, 1, 38, 38, 38, 38,
-        38, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 38, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 39,
-        1, 1, 1, 41, 41, 41, 41, 41,
-        41, 41, 41, 41, 41, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        40, 1, 42, 43, 1, 44, 1, 44,
-        44, 44, 44, 44, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 44, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        45, 1, 45, 45, 45, 45, 45, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 45, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 46, 1,
-        1, 47, 48, 48, 48, 48, 48, 48,
-        48, 48, 48, 1, 49, 50, 50, 50,
-        50, 50, 50, 50, 50, 50, 1, 51,
-        51, 51, 51, 51, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 51, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 52, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 53, 1, 51, 51, 51,
-        51, 51, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 51, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        52, 1, 1, 1, 50, 50, 50, 50,
-        50, 50, 50, 50, 50, 50, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 53, 1, 54, 1, 54, 54, 54,
-        54, 54, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 54, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 55, 1,
-        55, 55, 55, 55, 55, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 55,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 56, 1, 1, 57,
-        58, 58, 58, 58, 58, 58, 58, 58,
-        58, 1, 59, 60, 60, 60, 60, 60,
-        60, 60, 60, 60, 1, 61, 61, 61,
-        61, 61, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 61, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        62, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 63, 1, 61, 61, 61, 61, 61,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 61, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 62, 1,
-        1, 1, 60, 60, 60, 60, 60, 60,
-        60, 60, 60, 60, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 63,
-        1, 64, 1, 64, 64, 64, 64, 64,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 64, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 65, 1, 65, 65,
-        65, 65, 65, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 65, 1, 66,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 67, 68, 68,
-        68, 68, 68, 68, 68, 68, 68, 1,
-        69, 69, 69, 69, 69, 69, 69, 69,
-        69, 69, 69, 69, 69, 69, 69, 69,
-        69, 69, 69, 69, 69, 69, 69, 69,
-        69, 69, 1, 1, 1, 1, 1, 1,
-        69, 69, 69, 69, 69, 69, 69, 69,
-        69, 69, 69, 69, 69, 69, 69, 69,
-        69, 69, 69, 69, 69, 69, 69, 69,
-        69, 69, 1, 70, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 71, 71,
-        1, 71, 71, 71, 71, 71, 71, 71,
-        71, 71, 71, 1, 1, 1, 1, 1,
-        1, 1, 71, 71, 71, 71, 71, 71,
-        71, 71, 71, 71, 71, 71, 71, 71,
-        71, 71, 71, 71, 71, 71, 71, 71,
-        71, 71, 71, 71, 1, 1, 1, 1,
-        71, 1, 71, 71, 71, 71, 71, 71,
-        71, 71, 71, 71, 71, 71, 71, 71,
-        71, 71, 71, 71, 71, 71, 71, 71,
-        71, 71, 71, 71, 1, 72, 72, 72,
-        72, 72, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 72, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        73, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 74, 1, 72, 72, 72, 72, 72,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 72, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 73, 1,
-        1, 1, 75, 75, 75, 75, 75, 75,
-        75, 75, 75, 75, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 74,
-        1, 76, 76, 76, 76, 76, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        76, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 77, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 78, 1, 0,
-        0, 0, 0, 0, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 0, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
+        0, 0, 0, 0, 0, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        0, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 2, 1, 3, 3, 3, 
+        3, 3, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 3, 1, 4, 1, 
+        5, 1, 6, 7, 1, 1, 8, 1, 
+        9, 10, 1, 11, 1, 11, 11, 11, 
+        11, 11, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 11, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 12, 1, 
+        12, 12, 12, 12, 12, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 12, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 13, 1, 1, 14, 
+        15, 15, 15, 15, 15, 15, 15, 15, 
+        15, 1, 16, 17, 17, 17, 17, 17, 
+        17, 17, 17, 17, 1, 18, 18, 18, 
+        18, 18, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 18, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        19, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 20, 1, 21, 21, 21, 21, 21, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 21, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 3, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 22, 
+        1, 18, 18, 18, 18, 18, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        18, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 19, 1, 1, 1, 
+        17, 17, 17, 17, 17, 17, 17, 17, 
+        17, 17, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 20, 1, 23, 
+        1, 23, 23, 23, 23, 23, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        23, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 24, 1, 24, 24, 24, 24, 
+        24, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 24, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        25, 1, 1, 26, 27, 27, 27, 27, 
+        27, 27, 27, 27, 27, 1, 28, 29, 
+        29, 29, 29, 29, 29, 29, 29, 29, 
+        1, 30, 30, 30, 30, 30, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        30, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 31, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 32, 1, 30, 
+        30, 30, 30, 30, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 30, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 31, 1, 1, 1, 29, 29, 
+        29, 29, 29, 29, 29, 29, 29, 29, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 32, 1, 33, 1, 34, 
+        1, 34, 34, 34, 34, 34, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        34, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 35, 1, 35, 35, 35, 35, 
+        35, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 35, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 36, 37, 37, 37, 37, 
+        37, 37, 37, 37, 37, 1, 38, 38, 
+        38, 38, 38, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 38, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 39, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 40, 1, 38, 38, 38, 38, 
+        38, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 38, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 39, 
+        1, 1, 1, 41, 41, 41, 41, 41, 
+        41, 41, 41, 41, 41, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        40, 1, 42, 43, 1, 44, 1, 44, 
+        44, 44, 44, 44, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 44, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        45, 1, 45, 45, 45, 45, 45, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 45, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 46, 1, 
+        1, 47, 48, 48, 48, 48, 48, 48, 
+        48, 48, 48, 1, 49, 50, 50, 50, 
+        50, 50, 50, 50, 50, 50, 1, 51, 
+        51, 51, 51, 51, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 51, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 52, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 53, 1, 51, 51, 51, 
+        51, 51, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 51, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        52, 1, 1, 1, 50, 50, 50, 50, 
+        50, 50, 50, 50, 50, 50, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 53, 1, 54, 1, 54, 54, 54, 
+        54, 54, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 54, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 55, 1, 
+        55, 55, 55, 55, 55, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 55, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 56, 1, 1, 57, 
+        58, 58, 58, 58, 58, 58, 58, 58, 
+        58, 1, 59, 60, 60, 60, 60, 60, 
+        60, 60, 60, 60, 1, 61, 61, 61, 
+        61, 61, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 61, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        62, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 63, 1, 61, 61, 61, 61, 61, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 61, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 62, 1, 
+        1, 1, 60, 60, 60, 60, 60, 60, 
+        60, 60, 60, 60, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 63, 
+        1, 64, 1, 64, 64, 64, 64, 64, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 64, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 65, 1, 65, 65, 
+        65, 65, 65, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 65, 1, 66, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 67, 68, 68, 
+        68, 68, 68, 68, 68, 68, 68, 1, 
+        69, 69, 69, 69, 69, 69, 69, 69, 
+        69, 69, 69, 69, 69, 69, 69, 69, 
+        69, 69, 69, 69, 69, 69, 69, 69, 
+        69, 69, 1, 1, 1, 1, 1, 1, 
+        69, 69, 69, 69, 69, 69, 69, 69, 
+        69, 69, 69, 69, 69, 69, 69, 69, 
+        69, 69, 69, 69, 69, 69, 69, 69, 
+        69, 69, 1, 70, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 71, 71, 
+        1, 71, 71, 71, 71, 71, 71, 71, 
+        71, 71, 71, 1, 1, 1, 1, 1, 
+        1, 1, 71, 71, 71, 71, 71, 71, 
+        71, 71, 71, 71, 71, 71, 71, 71, 
+        71, 71, 71, 71, 71, 71, 71, 71, 
+        71, 71, 71, 71, 1, 1, 1, 1, 
+        71, 1, 71, 71, 71, 71, 71, 71, 
+        71, 71, 71, 71, 71, 71, 71, 71, 
+        71, 71, 71, 71, 71, 71, 71, 71, 
+        71, 71, 71, 71, 1, 72, 72, 72, 
+        72, 72, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 72, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        73, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 74, 1, 72, 72, 72, 72, 72, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 72, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 73, 1, 
+        1, 1, 75, 75, 75, 75, 75, 75, 
+        75, 75, 75, 75, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 74, 
+        1, 76, 76, 76, 76, 76, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        76, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 77, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 78, 1, 0, 
+        0, 0, 0, 0, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 0, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
         1, 2, 1, 1, 0
 };
 
 static const char _deserialize_json_trans_targs[] = {
-        1, 0, 2, 2, 3, 4, 18, 24,
-        37, 5, 12, 6, 7, 8, 9, 11,
-        9, 11, 10, 2, 44, 10, 44, 13,
-        14, 15, 16, 17, 16, 17, 10, 2,
-        44, 19, 20, 21, 22, 23, 10, 2,
-        44, 23, 25, 31, 26, 27, 28, 29,
-        30, 29, 30, 10, 2, 44, 32, 33,
-        34, 35, 36, 35, 36, 10, 2, 44,
-        38, 39, 40, 42, 43, 41, 10, 41,
+        1, 0, 2, 2, 3, 4, 18, 24, 
+        37, 5, 12, 6, 7, 8, 9, 11, 
+        9, 11, 10, 2, 44, 10, 44, 13, 
+        14, 15, 16, 17, 16, 17, 10, 2, 
+        44, 19, 20, 21, 22, 23, 10, 2, 
+        44, 23, 25, 31, 26, 27, 28, 29, 
+        30, 29, 30, 10, 2, 44, 32, 33, 
+        34, 35, 36, 35, 36, 10, 2, 44, 
+        38, 39, 40, 42, 43, 41, 10, 41, 
         10, 2, 44, 43, 44, 45, 46
 };
 
 static const char _deserialize_json_trans_actions[] = {
-        0, 0, 1, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 2, 2, 2,
-        0, 0, 3, 3, 4, 0, 5, 0,
-        0, 2, 2, 2, 0, 0, 6, 6,
-        7, 0, 0, 0, 2, 2, 8, 8,
-        9, 0, 0, 0, 0, 0, 2, 2,
-        2, 0, 0, 10, 10, 11, 0, 0,
-        2, 2, 2, 0, 0, 12, 12, 13,
-        0, 0, 0, 2, 2, 2, 14, 0,
+        0, 0, 1, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 2, 2, 2, 
+        0, 0, 3, 3, 4, 0, 5, 0, 
+        0, 2, 2, 2, 0, 0, 6, 6, 
+        7, 0, 0, 0, 2, 2, 8, 8, 
+        9, 0, 0, 0, 0, 0, 2, 2, 
+        2, 0, 0, 10, 10, 11, 0, 0, 
+        2, 2, 2, 0, 0, 12, 12, 13, 
+        0, 0, 0, 2, 2, 2, 14, 0, 
         15, 15, 16, 0, 0, 0, 0
 };
 
@@ -461,7 +461,7 @@
   int cs;
   hb_glyph_info_t info = {0};
   hb_glyph_position_t pos = {0};
-
+  
 #line 466 "hb-buffer-deserialize-json.hh"
         {
         cs = deserialize_json_start;
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-text.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-text.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -34,274 +34,274 @@
 
 #line 36 "hb-buffer-deserialize-text.hh"
 static const unsigned char _deserialize_text_trans_keys[] = {
-        0u, 0u, 9u, 122u, 45u, 57u, 48u, 57u, 45u, 57u, 48u, 57u, 48u, 57u, 45u, 57u,
-        48u, 57u, 44u, 44u, 45u, 57u, 48u, 57u, 44u, 57u, 9u, 124u, 9u, 124u, 0u, 0u,
-        9u, 122u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u,
+        0u, 0u, 9u, 122u, 45u, 57u, 48u, 57u, 45u, 57u, 48u, 57u, 48u, 57u, 45u, 57u, 
+        48u, 57u, 44u, 44u, 45u, 57u, 48u, 57u, 44u, 57u, 9u, 124u, 9u, 124u, 0u, 0u, 
+        9u, 122u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 
         9u, 124u, 9u, 124u, 9u, 124u, 0
 };
 
 static const char _deserialize_text_key_spans[] = {
-        0, 114, 13, 10, 13, 10, 10, 13,
-        10, 1, 13, 10, 14, 116, 116, 0,
-        114, 116, 116, 116, 116, 116, 116, 116,
+        0, 114, 13, 10, 13, 10, 10, 13, 
+        10, 1, 13, 10, 14, 116, 116, 0, 
+        114, 116, 116, 116, 116, 116, 116, 116, 
         116, 116, 116
 };
 
 static const short _deserialize_text_index_offsets[] = {
-        0, 0, 115, 129, 140, 154, 165, 176,
-        190, 201, 203, 217, 228, 243, 360, 477,
-        478, 593, 710, 827, 944, 1061, 1178, 1295,
+        0, 0, 115, 129, 140, 154, 165, 176, 
+        190, 201, 203, 217, 228, 243, 360, 477, 
+        478, 593, 710, 827, 944, 1061, 1178, 1295, 
         1412, 1529, 1646
 };
 
 static const char _deserialize_text_indicies[] = {
-        0, 0, 0, 0, 0, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        0, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        2, 3, 3, 3, 3, 3, 3, 3,
-        3, 3, 1, 1, 1, 1, 1, 1,
-        1, 4, 4, 4, 4, 4, 4, 4,
-        4, 4, 4, 4, 4, 4, 4, 4,
-        4, 4, 4, 4, 4, 4, 4, 4,
-        4, 4, 4, 1, 1, 1, 1, 1,
-        1, 4, 4, 4, 4, 4, 4, 4,
-        4, 4, 4, 4, 4, 4, 4, 4,
-        4, 4, 4, 4, 4, 4, 4, 4,
-        4, 4, 4, 1, 5, 1, 1, 6,
-        7, 7, 7, 7, 7, 7, 7, 7,
-        7, 1, 8, 9, 9, 9, 9, 9,
-        9, 9, 9, 9, 1, 10, 1, 1,
-        11, 12, 12, 12, 12, 12, 12, 12,
-        12, 12, 1, 13, 14, 14, 14, 14,
-        14, 14, 14, 14, 14, 1, 15, 16,
-        16, 16, 16, 16, 16, 16, 16, 16,
-        1, 17, 1, 1, 18, 19, 19, 19,
-        19, 19, 19, 19, 19, 19, 1, 20,
-        21, 21, 21, 21, 21, 21, 21, 21,
-        21, 1, 22, 1, 23, 1, 1, 24,
-        25, 25, 25, 25, 25, 25, 25, 25,
-        25, 1, 26, 27, 27, 27, 27, 27,
-        27, 27, 27, 27, 1, 22, 1, 1,
-        1, 21, 21, 21, 21, 21, 21, 21,
-        21, 21, 21, 1, 28, 28, 28, 28,
-        28, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 28, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 29, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        30, 1, 1, 31, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        32, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 33,
-        1, 34, 34, 34, 34, 34, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        34, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 35, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 36, 1, 1, 0,
-        0, 0, 0, 0, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 0, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 2, 3,
-        3, 3, 3, 3, 3, 3, 3, 3,
-        1, 1, 1, 1, 1, 1, 1, 4,
-        4, 4, 4, 4, 4, 4, 4, 4,
-        4, 4, 4, 4, 4, 4, 4, 4,
-        4, 4, 4, 4, 4, 4, 4, 4,
-        4, 1, 1, 1, 1, 1, 1, 4,
-        4, 4, 4, 4, 4, 4, 4, 4,
-        4, 4, 4, 4, 4, 4, 4, 4,
-        4, 4, 4, 4, 4, 4, 4, 4,
-        4, 1, 28, 28, 28, 28, 28, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 28, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 29, 1, 1, 1,
-        1, 37, 37, 37, 37, 37, 37, 37,
-        37, 37, 37, 1, 1, 1, 30, 1,
-        1, 31, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 32, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 33, 1, 38,
-        38, 38, 38, 38, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 38, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 39, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 40, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 41, 1, 42, 42, 42, 42,
-        42, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 42, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        43, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 44,
-        1, 42, 42, 42, 42, 42, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        42, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        14, 14, 14, 14, 14, 14, 14, 14,
-        14, 14, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 43, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 44, 1, 38, 38,
-        38, 38, 38, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 38, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 39, 1, 1, 1, 9, 9, 9,
-        9, 9, 9, 9, 9, 9, 9, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 40, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 41, 1, 45, 45, 45, 45, 45,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 45, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 46, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 47, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 48,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 49, 1,
-        50, 50, 50, 50, 50, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 50,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 51, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 52, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 53, 1, 50, 50, 50,
-        50, 50, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 50, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 51,
-        1, 1, 1, 1, 27, 27, 27, 27,
-        27, 27, 27, 27, 27, 27, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 52, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        53, 1, 45, 45, 45, 45, 45, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 45, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 46, 1, 1, 1,
-        1, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 1, 1, 1, 1, 1,
-        1, 47, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 48, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 49, 1, 28,
-        28, 28, 28, 28, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 28, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 29, 1, 55, 55, 1, 55, 55,
-        55, 55, 55, 55, 55, 55, 55, 55,
-        1, 1, 1, 30, 1, 1, 31, 55,
-        55, 55, 55, 55, 55, 55, 55, 55,
-        55, 55, 55, 55, 55, 55, 55, 55,
-        55, 55, 55, 55, 55, 55, 55, 55,
-        55, 1, 1, 32, 1, 55, 1, 55,
-        55, 55, 55, 55, 55, 55, 55, 55,
-        55, 55, 55, 55, 55, 55, 55, 55,
-        55, 55, 55, 55, 55, 55, 55, 55,
+        0, 0, 0, 0, 0, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        0, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        2, 3, 3, 3, 3, 3, 3, 3, 
+        3, 3, 1, 1, 1, 1, 1, 1, 
+        1, 4, 4, 4, 4, 4, 4, 4, 
+        4, 4, 4, 4, 4, 4, 4, 4, 
+        4, 4, 4, 4, 4, 4, 4, 4, 
+        4, 4, 4, 1, 1, 1, 1, 1, 
+        1, 4, 4, 4, 4, 4, 4, 4, 
+        4, 4, 4, 4, 4, 4, 4, 4, 
+        4, 4, 4, 4, 4, 4, 4, 4, 
+        4, 4, 4, 1, 5, 1, 1, 6, 
+        7, 7, 7, 7, 7, 7, 7, 7, 
+        7, 1, 8, 9, 9, 9, 9, 9, 
+        9, 9, 9, 9, 1, 10, 1, 1, 
+        11, 12, 12, 12, 12, 12, 12, 12, 
+        12, 12, 1, 13, 14, 14, 14, 14, 
+        14, 14, 14, 14, 14, 1, 15, 16, 
+        16, 16, 16, 16, 16, 16, 16, 16, 
+        1, 17, 1, 1, 18, 19, 19, 19, 
+        19, 19, 19, 19, 19, 19, 1, 20, 
+        21, 21, 21, 21, 21, 21, 21, 21, 
+        21, 1, 22, 1, 23, 1, 1, 24, 
+        25, 25, 25, 25, 25, 25, 25, 25, 
+        25, 1, 26, 27, 27, 27, 27, 27, 
+        27, 27, 27, 27, 1, 22, 1, 1, 
+        1, 21, 21, 21, 21, 21, 21, 21, 
+        21, 21, 21, 1, 28, 28, 28, 28, 
+        28, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 28, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 29, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        30, 1, 1, 31, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        32, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 33, 
+        1, 34, 34, 34, 34, 34, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        34, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 35, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 36, 1, 1, 0, 
+        0, 0, 0, 0, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 0, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 2, 3, 
+        3, 3, 3, 3, 3, 3, 3, 3, 
+        1, 1, 1, 1, 1, 1, 1, 4, 
+        4, 4, 4, 4, 4, 4, 4, 4, 
+        4, 4, 4, 4, 4, 4, 4, 4, 
+        4, 4, 4, 4, 4, 4, 4, 4, 
+        4, 1, 1, 1, 1, 1, 1, 4, 
+        4, 4, 4, 4, 4, 4, 4, 4, 
+        4, 4, 4, 4, 4, 4, 4, 4, 
+        4, 4, 4, 4, 4, 4, 4, 4, 
+        4, 1, 28, 28, 28, 28, 28, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 28, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 29, 1, 1, 1, 
+        1, 37, 37, 37, 37, 37, 37, 37, 
+        37, 37, 37, 1, 1, 1, 30, 1, 
+        1, 31, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 32, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 33, 1, 38, 
+        38, 38, 38, 38, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 38, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 39, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 40, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 41, 1, 42, 42, 42, 42, 
+        42, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 42, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        43, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 44, 
+        1, 42, 42, 42, 42, 42, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        42, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        14, 14, 14, 14, 14, 14, 14, 14, 
+        14, 14, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 43, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 44, 1, 38, 38, 
+        38, 38, 38, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 38, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 39, 1, 1, 1, 9, 9, 9, 
+        9, 9, 9, 9, 9, 9, 9, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 40, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 41, 1, 45, 45, 45, 45, 45, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 45, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 46, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 47, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 48, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 49, 1, 
+        50, 50, 50, 50, 50, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 50, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 51, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 52, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 53, 1, 50, 50, 50, 
+        50, 50, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 50, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 51, 
+        1, 1, 1, 1, 27, 27, 27, 27, 
+        27, 27, 27, 27, 27, 27, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 52, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        53, 1, 45, 45, 45, 45, 45, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 45, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 46, 1, 1, 1, 
+        1, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 1, 1, 1, 1, 1, 
+        1, 47, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 48, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 49, 1, 28, 
+        28, 28, 28, 28, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 28, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 29, 1, 55, 55, 1, 55, 55, 
+        55, 55, 55, 55, 55, 55, 55, 55, 
+        1, 1, 1, 30, 1, 1, 31, 55, 
+        55, 55, 55, 55, 55, 55, 55, 55, 
+        55, 55, 55, 55, 55, 55, 55, 55, 
+        55, 55, 55, 55, 55, 55, 55, 55, 
+        55, 1, 1, 32, 1, 55, 1, 55, 
+        55, 55, 55, 55, 55, 55, 55, 55, 
+        55, 55, 55, 55, 55, 55, 55, 55, 
+        55, 55, 55, 55, 55, 55, 55, 55, 
         55, 1, 33, 1, 0
 };
 
 static const char _deserialize_text_trans_targs[] = {
-        1, 0, 13, 17, 26, 3, 18, 21,
-        18, 21, 5, 19, 20, 19, 20, 22,
-        25, 8, 9, 12, 9, 12, 10, 11,
-        23, 24, 23, 24, 14, 2, 6, 7,
-        15, 16, 14, 15, 16, 17, 14, 4,
-        15, 16, 14, 15, 16, 14, 2, 7,
+        1, 0, 13, 17, 26, 3, 18, 21, 
+        18, 21, 5, 19, 20, 19, 20, 22, 
+        25, 8, 9, 12, 9, 12, 10, 11, 
+        23, 24, 23, 24, 14, 2, 6, 7, 
+        15, 16, 14, 15, 16, 17, 14, 4, 
+        15, 16, 14, 15, 16, 14, 2, 7, 
         15, 16, 14, 2, 15, 16, 25, 26
 };
 
 static const char _deserialize_text_trans_actions[] = {
-        0, 0, 1, 1, 1, 2, 2, 2,
-        0, 0, 2, 2, 2, 0, 0, 2,
-        2, 2, 2, 2, 0, 0, 3, 2,
-        2, 2, 0, 0, 4, 5, 5, 5,
-        4, 4, 0, 0, 0, 0, 6, 7,
-        6, 6, 8, 8, 8, 9, 10, 10,
+        0, 0, 1, 1, 1, 2, 2, 2, 
+        0, 0, 2, 2, 2, 0, 0, 2, 
+        2, 2, 2, 2, 0, 0, 3, 2, 
+        2, 2, 0, 0, 4, 5, 5, 5, 
+        4, 4, 0, 0, 0, 0, 6, 7, 
+        6, 6, 8, 8, 8, 9, 10, 10, 
         9, 9, 11, 12, 11, 11, 0, 0
 };
 
 static const char _deserialize_text_eof_actions[] = {
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 4, 0, 0,
-        0, 4, 6, 8, 8, 6, 9, 11,
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 4, 0, 0, 
+        0, 4, 6, 8, 8, 6, 9, 11, 
         11, 9, 4
 };
 
@@ -338,7 +338,7 @@
   int cs;
   hb_glyph_info_t info = {0};
   hb_glyph_position_t pos = {0};
-
+  
 #line 343 "hb-buffer-deserialize-text.hh"
         {
         cs = deserialize_text_start;
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -134,7 +134,7 @@
 #ifndef HB_NDEBUG
     unsigned int end = start + count;
     assert (end <= 8);
-    unsigned int bits = (1<<end) - (1<<start);
+    unsigned int bits = (1u<<end) - (1u<<start);
     assert (0 == (allocated_var_bits & bits));
     allocated_var_bits |= bits;
 #endif
@@ -144,7 +144,7 @@
 #ifndef HB_NDEBUG
     unsigned int end = start + count;
     assert (end <= 8);
-    unsigned int bits = (1<<end) - (1<<start);
+    unsigned int bits = (1u<<end) - (1u<<start);
     assert (bits == (allocated_var_bits & bits));
     allocated_var_bits &= ~bits;
 #endif
@@ -154,7 +154,7 @@
 #ifndef HB_NDEBUG
     unsigned int end = start + count;
     assert (end <= 8);
-    unsigned int bits = (1<<end) - (1<<start);
+    unsigned int bits = (1u<<end) - (1u<<start);
     assert (bits == (allocated_var_bits & bits));
 #endif
   }
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-serialize.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-serialize.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -58,7 +58,7 @@
  * @str is a valid buffer serialization format, use
  * hb_buffer_serialize_list_formats() to get the list of supported formats.
  *
- * Return value:
+ * Return value: 
  * The parsed #hb_buffer_serialize_format_t.
  *
  * Since: 0.9.7
@@ -289,7 +289,7 @@
  * ## json
  * TODO.
  *
- * Return value:
+ * Return value: 
  * The number of serialized items.
  *
  * Since: 0.9.7
@@ -393,14 +393,14 @@
  * hb_buffer_deserialize_glyphs:
  * @buffer: an #hb_buffer_t buffer.
  * @buf: (array length=buf_len):
- * @buf_len:
+ * @buf_len: 
  * @end_ptr: (out):
- * @font:
- * @format:
+ * @font: 
+ * @format: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.7
  **/
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -703,7 +703,7 @@
 /**
  * hb_buffer_get_empty:
  *
- *
+ * 
  *
  * Return value: (transfer full):
  *
@@ -780,14 +780,14 @@
 /**
  * hb_buffer_set_user_data: (skip)
  * @buffer: an #hb_buffer_t.
- * @key:
- * @data:
- * @destroy:
- * @replace:
+ * @key: 
+ * @data: 
+ * @destroy: 
+ * @replace: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -804,11 +804,11 @@
 /**
  * hb_buffer_get_user_data: (skip)
  * @buffer: an #hb_buffer_t.
- * @key:
- *
+ * @key: 
  *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -858,9 +858,9 @@
 /**
  * hb_buffer_set_unicode_funcs:
  * @buffer: an #hb_buffer_t.
- * @unicode_funcs:
+ * @unicode_funcs: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -884,9 +884,9 @@
  * hb_buffer_get_unicode_funcs:
  * @buffer: an #hb_buffer_t.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -1090,7 +1090,7 @@
  *
  * See hb_buffer_set_flags().
  *
- * Return value:
+ * Return value: 
  * The @buffer flags.
  *
  * Since: 0.9.7
@@ -1104,9 +1104,9 @@
 /**
  * hb_buffer_set_cluster_level:
  * @buffer: an #hb_buffer_t.
- * @cluster_level:
+ * @cluster_level: 
  *
- *
+ * 
  *
  * Since: 0.9.42
  **/
@@ -1124,9 +1124,9 @@
  * hb_buffer_get_cluster_level:
  * @buffer: an #hb_buffer_t.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.42
  **/
@@ -1165,7 +1165,7 @@
  *
  * See hb_buffer_set_replacement_codepoint().
  *
- * Return value:
+ * Return value: 
  * The @buffer replacement #hb_codepoint_t.
  *
  * Since: 0.9.31
@@ -1276,7 +1276,7 @@
  * Similar to hb_buffer_pre_allocate(), but clears any new items added at the
  * end.
  *
- * Return value:
+ * Return value: 
  * %true if @buffer memory allocation succeeded, %false otherwise.
  *
  * Since: 0.9.2
@@ -1786,7 +1786,7 @@
  * @user_data:
  * @destroy:
  *
- *
+ * 
  *
  * Since: 1.1.3
  **/
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-cache-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-cache-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -45,11 +45,11 @@
 
   inline bool get (unsigned int key, unsigned int *value)
   {
-    unsigned int k = key & ((1<<cache_bits)-1);
+    unsigned int k = key & ((1u<<cache_bits)-1);
     unsigned int v = values[k];
     if ((v >> value_bits) != (key >> cache_bits))
       return false;
-    *value = v & ((1<<value_bits)-1);
+    *value = v & ((1u<<value_bits)-1);
     return true;
   }
 
@@ -57,14 +57,14 @@
   {
     if (unlikely ((key >> key_bits) || (value >> value_bits)))
       return false; /* Overflows */
-    unsigned int k = key & ((1<<cache_bits)-1);
+    unsigned int k = key & ((1u<<cache_bits)-1);
     unsigned int v = ((key>>cache_bits)<<value_bits) | value;
     values[k] = v;
     return true;
   }
 
   private:
-  unsigned int values[1<<cache_bits];
+  unsigned int values[1u<<cache_bits];
 };
 
 typedef hb_cache_t<21, 16, 8> hb_cmap_cache_t;
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -57,12 +57,12 @@
 
 /**
  * hb_tag_from_string:
- * @str: (array length=len) (element-type uint8_t):
- * @len:
+ * @str: (array length=len) (element-type uint8_t): 
+ * @len: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -87,10 +87,10 @@
 
 /**
  * hb_tag_to_string:
- * @tag:
- * @buf: (out caller-allocates) (array fixed-size=4) (element-type uint8_t):
+ * @tag: 
+ * @buf: (out caller-allocates) (array fixed-size=4) (element-type uint8_t): 
  *
- *
+ * 
  *
  * Since: 0.9.5
  **/
@@ -115,12 +115,12 @@
 
 /**
  * hb_direction_from_string:
- * @str: (array length=len) (element-type uint8_t):
- * @len:
+ * @str: (array length=len) (element-type uint8_t): 
+ * @len: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -143,11 +143,11 @@
 
 /**
  * hb_direction_to_string:
- * @direction:
- *
+ * @direction: 
  *
+ * 
  *
- * Return value: (transfer none):
+ * Return value: (transfer none): 
  *
  * Since: 0.9.2
  **/
@@ -337,7 +337,7 @@
 /**
  * hb_language_get_default:
  *
- *
+ * 
  *
  * Return value: (transfer none):
  *
@@ -366,7 +366,7 @@
  *
  * Converts an ISO 15924 script tag to a corresponding #hb_script_t.
  *
- * Return value:
+ * Return value: 
  * An #hb_script_t corresponding to the ISO 15924 tag.
  *
  * Since: 0.9.2
@@ -415,7 +415,7 @@
  * corresponding #hb_script_t. Shorthand for hb_tag_from_string() then
  * hb_script_from_iso15924_tag().
  *
- * Return value:
+ * Return value: 
  * An #hb_script_t corresponding to the ISO 15924 tag.
  *
  * Since: 0.9.2
@@ -445,11 +445,11 @@
 
 /**
  * hb_script_get_horizontal_direction:
- * @script:
- *
+ * @script: 
  *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -588,13 +588,13 @@
 
 /**
  * hb_version_atleast:
- * @major:
- * @minor:
- * @micro:
+ * @major: 
+ * @minor: 
+ * @micro: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.30
  **/
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-coretext.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-coretext.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -145,6 +145,22 @@
     DEBUG_MSG (CORETEXT, cg_font, "Font CTFontCreateWithGraphicsFont() failed");
     return NULL;
   }
+
+  /* crbug.com/576941 and crbug.com/625902 and the investigation in the latter
+   * bug indicate that the cascade list reconfiguration occasionally causes
+   * crashes in CoreText on OS X 10.9, thus let's skip this step on older
+   * operating system versions. Except for the emoji font, where _not_
+   * reconfiguring the cascade list causes CoreText crashes. For details, see
+   * crbug.com/549610 */
+  // 0x00070000 stands for "kCTVersionNumber10_10", see CoreText.h
+  if (&CTGetCoreTextVersion != NULL && CTGetCoreTextVersion() < 0x00070000) {
+    CFStringRef fontName = CTFontCopyPostScriptName (ct_font);
+    bool isEmojiFont = CFStringCompare (fontName, CFSTR("AppleColorEmoji"), 0) == kCFCompareEqualTo;
+    CFRelease (fontName);
+    if (!isEmojiFont)
+      return ct_font;
+  }
+
   CFURLRef original_url = (CFURLRef)CTFontCopyAttribute(ct_font, kCTFontURLAttribute);
 
   /* Create font copy with cascade list that has LastResort first; this speeds up CoreText
@@ -272,7 +288,9 @@
 hb_coretext_shaper_shape_plan_data_t *
 _hb_coretext_shaper_shape_plan_data_create (hb_shape_plan_t    *shape_plan HB_UNUSED,
                                              const hb_feature_t *user_features HB_UNUSED,
-                                             unsigned int        num_user_features HB_UNUSED)
+                                             unsigned int        num_user_features HB_UNUSED,
+                                             const int          *coords HB_UNUSED,
+                                             unsigned int        num_coords HB_UNUSED)
 {
   return (hb_coretext_shaper_shape_plan_data_t *) HB_SHAPER_DATA_SUCCEEDED;
 }
@@ -717,7 +735,7 @@
       pchars[chars_len++] = 0xFFFDu;
     else {
       pchars[chars_len++] = 0xD800u + ((c - 0x10000u) >> 10);
-      pchars[chars_len++] = 0xDC00u + ((c - 0x10000u) & ((1 << 10) - 1));
+      pchars[chars_len++] = 0xDC00u + ((c - 0x10000u) & ((1u << 10) - 1));
     }
   }
 
@@ -1264,7 +1282,9 @@
 hb_coretext_aat_shaper_shape_plan_data_t *
 _hb_coretext_aat_shaper_shape_plan_data_create (hb_shape_plan_t    *shape_plan HB_UNUSED,
                                              const hb_feature_t *user_features HB_UNUSED,
-                                             unsigned int        num_user_features HB_UNUSED)
+                                             unsigned int        num_user_features HB_UNUSED,
+                                             const int          *coords HB_UNUSED,
+                                             unsigned int        num_coords HB_UNUSED)
 {
   return (hb_coretext_aat_shaper_shape_plan_data_t *) HB_SHAPER_DATA_SUCCEEDED;
 }
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -35,8 +35,6 @@
 #include "hb-ot-head-table.hh"
 #include "hb-ot-maxp-table.hh"
 
-#include "hb-cache-private.hh"
-
 #include <string.h>
 
 
@@ -70,10 +68,10 @@
 /**
  * hb_face_create_for_tables:
  * @reference_table_func: (closure user_data) (destroy destroy) (scope notified):
- * @user_data:
- * @destroy:
+ * @user_data: 
+ * @destroy: 
  *
- *
+ * 
  *
  * Return value: (transfer full)
  *
@@ -150,10 +148,10 @@
 
 /**
  * hb_face_create: (Xconstructor)
- * @blob:
- * @index:
+ * @blob: 
+ * @index: 
  *
- *
+ * 
  *
  * Return value: (transfer full):
  *
@@ -185,7 +183,7 @@
 /**
  * hb_face_get_empty:
  *
- *
+ * 
  *
  * Return value: (transfer full)
  *
@@ -202,9 +200,9 @@
  * hb_face_reference: (skip)
  * @face: a face.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -218,7 +216,7 @@
  * hb_face_destroy: (skip)
  * @face: a face.
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -248,14 +246,14 @@
 /**
  * hb_face_set_user_data: (skip)
  * @face: a face.
- * @key:
- * @data:
- * @destroy:
- * @replace:
+ * @key: 
+ * @data: 
+ * @destroy: 
+ * @replace: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -272,9 +270,9 @@
 /**
  * hb_face_get_user_data: (skip)
  * @face: a face.
- * @key:
+ * @key: 
  *
- *
+ * 
  *
  * Return value: (transfer none):
  *
@@ -291,7 +289,7 @@
  * hb_face_make_immutable:
  * @face: a face.
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -308,9 +306,9 @@
  * hb_face_is_immutable:
  * @face: a face.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -324,9 +322,9 @@
 /**
  * hb_face_reference_table:
  * @face: a face.
- * @tag:
+ * @tag: 
  *
- *
+ * 
  *
  * Return value: (transfer full):
  *
@@ -343,7 +341,7 @@
  * hb_face_reference_blob:
  * @face: a face.
  *
- *
+ * 
  *
  * Return value: (transfer full):
  *
@@ -358,9 +356,9 @@
 /**
  * hb_face_set_index:
  * @face: a face.
- * @index:
+ * @index: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -378,9 +376,9 @@
  * hb_face_get_index:
  * @face: a face.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -393,9 +391,9 @@
 /**
  * hb_face_set_upem:
  * @face: a face.
- * @upem:
+ * @upem: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -413,9 +411,9 @@
  * hb_face_get_upem:
  * @face: a face.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -437,9 +435,9 @@
 /**
  * hb_face_set_glyph_count:
  * @face: a face.
- * @glyph_count:
+ * @glyph_count: 
  *
- *
+ * 
  *
  * Since: 0.9.7
  **/
@@ -457,9 +455,9 @@
  * hb_face_get_glyph_count:
  * @face: a face.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.7
  **/
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-fallback-shape.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-fallback-shape.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -73,7 +73,9 @@
 hb_fallback_shaper_shape_plan_data_t *
 _hb_fallback_shaper_shape_plan_data_create (hb_shape_plan_t    *shape_plan HB_UNUSED,
                                             const hb_feature_t *user_features HB_UNUSED,
-                                            unsigned int        num_user_features HB_UNUSED)
+                                            unsigned int        num_user_features HB_UNUSED,
+                                            const int          *coords HB_UNUSED,
+                                            unsigned int        num_coords HB_UNUSED)
 {
   return (hb_fallback_shaper_shape_plan_data_t *) HB_SHAPER_DATA_SUCCEEDED;
 }
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -108,6 +108,10 @@
   unsigned int x_ppem;
   unsigned int y_ppem;
 
+  /* Font variation coordinates. */
+  unsigned int num_coords;
+  int *coords;
+
   hb_font_funcs_t   *klass;
   void              *user_data;
   hb_destroy_func_t  destroy;
@@ -116,8 +120,14 @@
 
 
   /* Convert from font-space to user-space */
-  inline hb_position_t em_scale_x (int16_t v) { return em_scale (v, this->x_scale); }
-  inline hb_position_t em_scale_y (int16_t v) { return em_scale (v, this->y_scale); }
+  inline int dir_scale (hb_direction_t direction)
+  { return HB_DIRECTION_IS_VERTICAL(direction) ? y_scale : x_scale; }
+  inline hb_position_t em_scale_x (int16_t v) { return em_scale (v, x_scale); }
+  inline hb_position_t em_scale_y (int16_t v) { return em_scale (v, y_scale); }
+  inline hb_position_t em_scalef_x (float v) { return em_scalef (v, this->x_scale); }
+  inline hb_position_t em_scalef_y (float v) { return em_scalef (v, this->y_scale); }
+  inline hb_position_t em_scale_dir (int16_t v, hb_direction_t direction)
+  { return em_scale (v, dir_scale (direction)); }
 
   /* Convert from parent-font user-space to our user-space */
   inline hb_position_t parent_scale_x_distance (hb_position_t v) {
@@ -292,24 +302,32 @@
 
   /* A bit higher-level, and with fallback */
 
+  inline void get_h_extents_with_fallback (hb_font_extents_t *extents)
+  {
+    if (!get_font_h_extents (extents))
+    {
+      extents->ascender = y_scale * .8;
+      extents->descender = extents->ascender - y_scale;
+      extents->line_gap = 0;
+    }
+  }
+  inline void get_v_extents_with_fallback (hb_font_extents_t *extents)
+  {
+    if (!get_font_v_extents (extents))
+    {
+      extents->ascender = x_scale / 2;
+      extents->descender = extents->ascender - x_scale;
+      extents->line_gap = 0;
+    }
+  }
+
   inline void get_extents_for_direction (hb_direction_t direction,
                                          hb_font_extents_t *extents)
   {
-    if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) {
-      if (!get_font_h_extents (extents))
-      {
-        extents->ascender = y_scale * .8;
-        extents->descender = y_scale - extents->ascender;
-        extents->line_gap = 0;
-      }
-    } else {
-      if (!get_font_v_extents (extents))
-      {
-        extents->ascender = x_scale / 2;
-        extents->descender = x_scale - extents->ascender;
-        extents->line_gap = 0;
-      }
-    }
+    if (likely (HB_DIRECTION_IS_HORIZONTAL (direction)))
+      get_h_extents_with_fallback (extents);
+    else
+      get_v_extents_with_fallback (extents);
   }
 
   inline void get_glyph_advance_for_direction (hb_codepoint_t glyph,
@@ -325,14 +343,38 @@
     }
   }
 
-  /* Internal only */
   inline void guess_v_origin_minus_h_origin (hb_codepoint_t glyph,
                                              hb_position_t *x, hb_position_t *y)
   {
     *x = get_glyph_h_advance (glyph) / 2;
 
-    /* TODO use font_extents.ascender */
-    *y = y_scale;
+    /* TODO cache this somehow?! */
+    hb_font_extents_t extents;
+    get_h_extents_with_fallback (&extents);
+    *y = extents.ascender;
+  }
+
+  inline void get_glyph_h_origin_with_fallback (hb_codepoint_t glyph,
+                                                hb_position_t *x, hb_position_t *y)
+  {
+    if (!get_glyph_h_origin (glyph, x, y) &&
+         get_glyph_v_origin (glyph, x, y))
+    {
+      hb_position_t dx, dy;
+      guess_v_origin_minus_h_origin (glyph, &dx, &dy);
+      *x -= dx; *y -= dy;
+    }
+  }
+  inline void get_glyph_v_origin_with_fallback (hb_codepoint_t glyph,
+                                                hb_position_t *x, hb_position_t *y)
+  {
+    if (!get_glyph_v_origin (glyph, x, y) &&
+         get_glyph_h_origin (glyph, x, y))
+    {
+      hb_position_t dx, dy;
+      guess_v_origin_minus_h_origin (glyph, &dx, &dy);
+      *x += dx; *y += dy;
+    }
   }
 
   inline void get_glyph_origin_for_direction (hb_codepoint_t glyph,
@@ -340,25 +382,9 @@
                                               hb_position_t *x, hb_position_t *y)
   {
     if (likely (HB_DIRECTION_IS_HORIZONTAL (direction)))
-    {
-      if (!get_glyph_h_origin (glyph, x, y) &&
-           get_glyph_v_origin (glyph, x, y))
-      {
-        hb_position_t dx, dy;
-        guess_v_origin_minus_h_origin (glyph, &dx, &dy);
-        *x -= dx; *y -= dy;
-      }
-    }
+      get_glyph_h_origin_with_fallback (glyph, x, y);
     else
-    {
-      if (!get_glyph_v_origin (glyph, x, y) &&
-           get_glyph_h_origin (glyph, x, y))
-      {
-        hb_position_t dx, dy;
-        guess_v_origin_minus_h_origin (glyph, &dx, &dy);
-        *x += dx; *y += dy;
-      }
-    }
+      get_glyph_v_origin_with_fallback (glyph, x, y);
   }
 
   inline void add_glyph_h_origin (hb_codepoint_t glyph,
@@ -366,7 +392,7 @@
   {
     hb_position_t origin_x, origin_y;
 
-    get_glyph_h_origin (glyph, &origin_x, &origin_y);
+    get_glyph_h_origin_with_fallback (glyph, &origin_x, &origin_y);
 
     *x += origin_x;
     *y += origin_y;
@@ -376,7 +402,7 @@
   {
     hb_position_t origin_x, origin_y;
 
-    get_glyph_v_origin (glyph, &origin_x, &origin_y);
+    get_glyph_v_origin_with_fallback (glyph, &origin_x, &origin_y);
 
     *x += origin_x;
     *y += origin_y;
@@ -398,7 +424,7 @@
   {
     hb_position_t origin_x, origin_y;
 
-    get_glyph_h_origin (glyph, &origin_x, &origin_y);
+    get_glyph_h_origin_with_fallback (glyph, &origin_x, &origin_y);
 
     *x -= origin_x;
     *y -= origin_y;
@@ -408,7 +434,7 @@
   {
     hb_position_t origin_x, origin_y;
 
-    get_glyph_v_origin (glyph, &origin_x, &origin_y);
+    get_glyph_v_origin_with_fallback (glyph, &origin_x, &origin_y);
 
     *x -= origin_x;
     *y -= origin_y;
@@ -504,7 +530,6 @@
     return false;
   }
 
-  private:
   inline hb_position_t em_scale (int16_t v, int scale)
   {
     int upem = face->get_upem ();
@@ -512,6 +537,10 @@
     scaled += scaled >= 0 ? upem/2 : -upem/2; /* Round. */
     return (hb_position_t) (scaled / upem);
   }
+  inline hb_position_t em_scalef (float v, int scale)
+  {
+    return (hb_position_t) (v * scale / face->get_upem ());
+  }
 };
 
 #define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -35,8 +35,6 @@
 #include "hb-ot-head-table.hh"
 #include "hb-ot-maxp-table.hh"
 
-#include "hb-cache-private.hh"
-
 #include <string.h>
 
 
@@ -401,9 +399,9 @@
 /**
  * hb_font_funcs_create: (Xconstructor)
  *
- *
+ * 
  *
- * Return value: (transfer full):
+ * Return value: (transfer full): 
  *
  * Since: 0.9.2
  **/
@@ -423,9 +421,9 @@
 /**
  * hb_font_funcs_get_empty:
  *
- *
+ * 
  *
- * Return value: (transfer full):
+ * Return value: (transfer full): 
  *
  * Since: 0.9.2
  **/
@@ -439,9 +437,9 @@
  * hb_font_funcs_reference: (skip)
  * @ffuncs: font functions.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -455,7 +453,7 @@
  * hb_font_funcs_destroy: (skip)
  * @ffuncs: font functions.
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -475,14 +473,14 @@
 /**
  * hb_font_funcs_set_user_data: (skip)
  * @ffuncs: font functions.
- * @key:
- * @data:
- * @destroy:
- * @replace:
+ * @key: 
+ * @data: 
+ * @destroy: 
+ * @replace: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -499,11 +497,11 @@
 /**
  * hb_font_funcs_get_user_data: (skip)
  * @ffuncs: font functions.
- * @key:
- *
+ * @key: 
  *
+ * 
  *
- * Return value: (transfer none):
+ * Return value: (transfer none): 
  *
  * Since: 0.9.2
  **/
@@ -519,7 +517,7 @@
  * hb_font_funcs_make_immutable:
  * @ffuncs: font functions.
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -536,9 +534,9 @@
  * hb_font_funcs_is_immutable:
  * @ffuncs: font functions.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -629,13 +627,13 @@
 /**
  * hb_font_get_glyph:
  * @font: a font.
- * @unicode:
- * @variation_selector:
- * @glyph: (out):
+ * @unicode: 
+ * @variation_selector: 
+ * @glyph: (out): 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -652,12 +650,12 @@
 /**
  * hb_font_get_nominal_glyph:
  * @font: a font.
- * @unicode:
- * @glyph: (out):
+ * @unicode: 
+ * @glyph: (out): 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 1.2.3
  **/
@@ -672,13 +670,13 @@
 /**
  * hb_font_get_variation_glyph:
  * @font: a font.
- * @unicode:
- * @variation_selector:
- * @glyph: (out):
+ * @unicode: 
+ * @variation_selector: 
+ * @glyph: (out): 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 1.2.3
  **/
@@ -693,11 +691,11 @@
 /**
  * hb_font_get_glyph_h_advance:
  * @font: a font.
- * @glyph:
- *
+ * @glyph: 
  *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -711,11 +709,11 @@
 /**
  * hb_font_get_glyph_v_advance:
  * @font: a font.
- * @glyph:
- *
+ * @glyph: 
  *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -729,13 +727,13 @@
 /**
  * hb_font_get_glyph_h_origin:
  * @font: a font.
- * @glyph:
- * @x: (out):
- * @y: (out):
+ * @glyph: 
+ * @x: (out): 
+ * @y: (out): 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -750,13 +748,13 @@
 /**
  * hb_font_get_glyph_v_origin:
  * @font: a font.
- * @glyph:
- * @x: (out):
- * @y: (out):
+ * @glyph: 
+ * @x: (out): 
+ * @y: (out): 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -771,12 +769,12 @@
 /**
  * hb_font_get_glyph_h_kerning:
  * @font: a font.
- * @left_glyph:
- * @right_glyph:
+ * @left_glyph: 
+ * @right_glyph: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -790,12 +788,12 @@
 /**
  * hb_font_get_glyph_v_kerning:
  * @font: a font.
- * @top_glyph:
- * @bottom_glyph:
+ * @top_glyph: 
+ * @bottom_glyph: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -809,12 +807,12 @@
 /**
  * hb_font_get_glyph_extents:
  * @font: a font.
- * @glyph:
- * @extents: (out):
+ * @glyph: 
+ * @extents: (out): 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -829,14 +827,14 @@
 /**
  * hb_font_get_glyph_contour_point:
  * @font: a font.
- * @glyph:
- * @point_index:
- * @x: (out):
- * @y: (out):
+ * @glyph: 
+ * @point_index: 
+ * @x: (out): 
+ * @y: (out): 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -851,13 +849,13 @@
 /**
  * hb_font_get_glyph_name:
  * @font: a font.
- * @glyph:
- * @name: (array length=size):
- * @size:
+ * @glyph: 
+ * @name: (array length=size): 
+ * @size: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -872,13 +870,13 @@
 /**
  * hb_font_get_glyph_from_name:
  * @font: a font.
- * @name: (array length=len):
- * @len:
- * @glyph: (out):
+ * @name: (array length=len): 
+ * @len: 
+ * @glyph: (out): 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -913,12 +911,12 @@
 /**
  * hb_font_get_glyph_advance_for_direction:
  * @font: a font.
- * @glyph:
- * @direction:
- * @x: (out):
- * @y: (out):
+ * @glyph: 
+ * @direction: 
+ * @x: (out): 
+ * @y: (out): 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -934,12 +932,12 @@
 /**
  * hb_font_get_glyph_origin_for_direction:
  * @font: a font.
- * @glyph:
- * @direction:
- * @x: (out):
- * @y: (out):
+ * @glyph: 
+ * @direction: 
+ * @x: (out): 
+ * @y: (out): 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -955,12 +953,12 @@
 /**
  * hb_font_add_glyph_origin_for_direction:
  * @font: a font.
- * @glyph:
- * @direction:
- * @x: (out):
- * @y: (out):
+ * @glyph: 
+ * @direction: 
+ * @x: (out): 
+ * @y: (out): 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -976,12 +974,12 @@
 /**
  * hb_font_subtract_glyph_origin_for_direction:
  * @font: a font.
- * @glyph:
- * @direction:
- * @x: (out):
- * @y: (out):
+ * @glyph: 
+ * @direction: 
+ * @x: (out): 
+ * @y: (out): 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -997,13 +995,13 @@
 /**
  * hb_font_get_glyph_kerning_for_direction:
  * @font: a font.
- * @first_glyph:
- * @second_glyph:
- * @direction:
- * @x: (out):
- * @y: (out):
+ * @first_glyph: 
+ * @second_glyph: 
+ * @direction: 
+ * @x: (out): 
+ * @y: (out): 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -1019,13 +1017,13 @@
 /**
  * hb_font_get_glyph_extents_for_origin:
  * @font: a font.
- * @glyph:
- * @direction:
- * @extents: (out):
+ * @glyph: 
+ * @direction: 
+ * @extents: (out): 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -1041,15 +1039,15 @@
 /**
  * hb_font_get_glyph_contour_point_for_origin:
  * @font: a font.
- * @glyph:
- * @point_index:
- * @direction:
- * @x: (out):
- * @y: (out):
+ * @glyph: 
+ * @point_index: 
+ * @direction: 
+ * @x: (out): 
+ * @y: (out): 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -1066,11 +1064,11 @@
 /**
  * hb_font_glyph_to_string:
  * @font: a font.
- * @glyph:
- * @s: (array length=size):
- * @size:
+ * @glyph: 
+ * @s: (array length=size): 
+ * @size: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -1086,13 +1084,13 @@
 /**
  * hb_font_glyph_from_string:
  * @font: a font.
- * @s: (array length=len) (element-type uint8_t):
- * @len:
- * @glyph: (out):
+ * @s: (array length=len) (element-type uint8_t): 
+ * @len: 
+ * @glyph: (out): 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -1113,9 +1111,9 @@
  * hb_font_create: (Xconstructor)
  * @face: a face.
  *
- *
+ * 
  *
- * Return value: (transfer full):
+ * Return value: (transfer full): 
  *
  * Since: 0.9.2
  **/
@@ -1143,9 +1141,9 @@
  * hb_font_create_sub_font:
  * @parent: parent font.
  *
- *
+ * 
  *
- * Return value: (transfer full):
+ * Return value: (transfer full): 
  *
  * Since: 0.9.2
  **/
@@ -1167,13 +1165,15 @@
   font->x_ppem = parent->x_ppem;
   font->y_ppem = parent->y_ppem;
 
+  /* TODO: copy variation coordinates. */
+
   return font;
 }
 
 /**
  * hb_font_get_empty:
  *
- *
+ * 
  *
  * Return value: (transfer full)
  *
@@ -1196,6 +1196,9 @@
     0, /* x_ppem */
     0, /* y_ppem */
 
+    0, /* num_coords */
+    NULL, /* coords */
+
     const_cast<hb_font_funcs_t *> (&_hb_font_funcs_nil), /* klass */
     NULL, /* user_data */
     NULL, /* destroy */
@@ -1214,9 +1217,9 @@
  * hb_font_reference: (skip)
  * @font: a font.
  *
- *
+ * 
  *
- * Return value: (transfer full):
+ * Return value: (transfer full): 
  *
  * Since: 0.9.2
  **/
@@ -1230,7 +1233,7 @@
  * hb_font_destroy: (skip)
  * @font: a font.
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -1250,20 +1253,22 @@
   hb_face_destroy (font->face);
   hb_font_funcs_destroy (font->klass);
 
+  free (font->coords);
+
   free (font);
 }
 
 /**
  * hb_font_set_user_data: (skip)
  * @font: a font.
- * @key:
- * @data:
- * @destroy:
- * @replace:
+ * @key: 
+ * @data: 
+ * @destroy: 
+ * @replace: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -1280,11 +1285,11 @@
 /**
  * hb_font_get_user_data: (skip)
  * @font: a font.
- * @key:
- *
+ * @key: 
  *
+ * 
  *
- * Return value: (transfer none):
+ * Return value: (transfer none): 
  *
  * Since: 0.9.2
  **/
@@ -1299,7 +1304,7 @@
  * hb_font_make_immutable:
  * @font: a font.
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -1319,9 +1324,9 @@
  * hb_font_is_immutable:
  * @font: a font.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -1361,9 +1366,9 @@
  * hb_font_get_parent:
  * @font: a font.
  *
- *
+ * 
  *
- * Return value: (transfer none):
+ * Return value: (transfer none): 
  *
  * Since: 0.9.2
  **/
@@ -1377,9 +1382,9 @@
  * hb_font_get_face:
  * @font: a font.
  *
- *
+ * 
  *
- * Return value: (transfer none):
+ * Return value: (transfer none): 
  *
  * Since: 0.9.2
  **/
@@ -1394,10 +1399,10 @@
  * hb_font_set_funcs:
  * @font: a font.
  * @klass: (closure font_data) (destroy destroy) (scope notified):
- * @font_data:
- * @destroy:
+ * @font_data: 
+ * @destroy: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -1430,9 +1435,9 @@
  * hb_font_set_funcs_data:
  * @font: a font.
  * @font_data: (destroy destroy) (scope notified):
- * @destroy:
+ * @destroy: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -1459,10 +1464,10 @@
 /**
  * hb_font_set_scale:
  * @font: a font.
- * @x_scale:
- * @y_scale:
+ * @x_scale: 
+ * @y_scale: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -1481,10 +1486,10 @@
 /**
  * hb_font_get_scale:
  * @font: a font.
- * @x_scale: (out):
- * @y_scale: (out):
+ * @x_scale: (out): 
+ * @y_scale: (out): 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -1500,10 +1505,10 @@
 /**
  * hb_font_set_ppem:
  * @font: a font.
- * @x_ppem:
- * @y_ppem:
+ * @x_ppem: 
+ * @y_ppem: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -1522,10 +1527,10 @@
 /**
  * hb_font_get_ppem:
  * @font: a font.
- * @x_ppem: (out):
- * @y_ppem: (out):
+ * @x_ppem: (out): 
+ * @y_ppem: (out): 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -1539,6 +1544,32 @@
 }
 
 
+void
+hb_font_set_var_coords_normalized (hb_font_t *font,
+                                   int *coords, /* XXX 2.14 normalized */
+                                   unsigned int coords_length)
+{
+  if (font->immutable)
+    return;
+
+  /* Skip tail zero entries. */
+  while (coords_length && !coords[coords_length - 1])
+    coords_length--;
+
+  int *copy = coords_length ? (int *) calloc (coords_length, sizeof (coords[0])) : NULL;
+  if (unlikely (coords_length && !copy))
+    return;
+
+  free (font->coords);
+
+  if (coords_length)
+    memcpy (copy, coords, coords_length * sizeof (coords[0]));
+
+  font->coords = copy;
+  font->num_coords = coords_length;
+}
+
+
 #ifndef HB_DISABLE_DEPRECATED
 
 /*
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.h	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.h	Sat Jan 21 03:53:21 2017 +0000
@@ -604,6 +604,11 @@
                   unsigned int *y_ppem);
 
 
+HB_EXTERN void
+hb_font_set_var_coords_normalized (hb_font_t *font,
+                                   int *coords, /* XXX 2.14 normalized */
+                                   unsigned int coords_length);
+
 HB_END_DECLS
 
 #endif /* HB_FONT_H */
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ft.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ft.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -33,7 +33,10 @@
 
 #include "hb-font-private.hh"
 
+#include "hb-cache-private.hh" // Maybe use in the future?
+
 #include FT_ADVANCES_H
+#include FT_MULTIPLE_MASTERS_H
 #include FT_TRUETYPE_TABLES_H
 
 
@@ -111,7 +114,7 @@
  * @font:
  * @load_flags:
  *
- *
+ * 
  *
  * Since: 1.0.5
  **/
@@ -133,7 +136,7 @@
  * hb_ft_font_get_load_flags:
  * @font:
  *
- *
+ * 
  *
  * Return value:
  * Since: 1.0.5
@@ -504,12 +507,12 @@
 
 /**
  * hb_ft_face_create:
- * @ft_face: (destroy destroy) (scope notified):
+ * @ft_face: (destroy destroy) (scope notified): 
  * @destroy:
  *
- *
+ * 
  *
- * Return value: (transfer full):
+ * Return value: (transfer full): 
  * Since: 0.9.2
  **/
 hb_face_t *
@@ -541,9 +544,9 @@
  * hb_ft_face_create_referenced:
  * @ft_face:
  *
- *
+ * 
  *
- * Return value: (transfer full):
+ * Return value: (transfer full): 
  * Since: 0.9.38
  **/
 hb_face_t *
@@ -561,11 +564,11 @@
 
 /**
  * hb_ft_face_create_cached:
- * @ft_face:
- *
+ * @ft_face: 
  *
+ * 
  *
- * Return value: (transfer full):
+ * Return value: (transfer full): 
  * Since: 0.9.2
  **/
 hb_face_t *
@@ -586,12 +589,12 @@
 
 /**
  * hb_ft_font_create:
- * @ft_face: (destroy destroy) (scope notified):
+ * @ft_face: (destroy destroy) (scope notified): 
  * @destroy:
  *
- *
+ * 
  *
- * Return value: (transfer full):
+ * Return value: (transfer full): 
  * Since: 0.9.2
  **/
 hb_font_t *
@@ -606,14 +609,31 @@
   hb_face_destroy (face);
   _hb_ft_font_set_funcs (font, ft_face, false);
   hb_font_set_scale (font,
-                     (int) (((uint64_t) ft_face->size->metrics.x_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16),
-                     (int) (((uint64_t) ft_face->size->metrics.y_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16));
+                     (int) (((uint64_t) ft_face->size->metrics.x_scale * (uint64_t) ft_face->units_per_EM + (1u<<15)) >> 16),
+                     (int) (((uint64_t) ft_face->size->metrics.y_scale * (uint64_t) ft_face->units_per_EM + (1u<<15)) >> 16));
 #if 0 /* hb-ft works in no-hinting model */
   hb_font_set_ppem (font,
                     ft_face->size->metrics.x_ppem,
                     ft_face->size->metrics.y_ppem);
 #endif
 
+#ifdef HAVE_FT_GET_VAR_BLEND_COORDINATES
+  FT_MM_Var *mm_var = NULL;
+  if (!FT_Get_MM_Var (ft_face, &mm_var))
+  {
+    FT_Fixed coords[mm_var->num_axis];
+    int hbCoords[mm_var->num_axis];
+    if (!FT_Get_Var_Blend_Coordinates (ft_face, mm_var->num_axis, coords))
+    {
+      for (int i = 0; i < mm_var->num_axis; ++i)
+        hbCoords[i] = coords[i] >> 2;
+
+      hb_font_set_var_coords_normalized (font, hbCoords, mm_var->num_axis);
+    }
+  }
+  free (mm_var);
+#endif
+
   return font;
 }
 
@@ -621,9 +641,9 @@
  * hb_ft_font_create_referenced:
  * @ft_face:
  *
- *
+ * 
  *
- * Return value: (transfer full):
+ * Return value: (transfer full): 
  * Since: 0.9.38
  **/
 hb_font_t *
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-type-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-type-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -105,7 +105,7 @@
   inline unsigned int get_size (void) const { return (size); }
 
 #define DEFINE_SIZE_UNION(size, _member) \
-  DEFINE_INSTANCE_ASSERTION (this->u._member.static_size == (size)); \
+  DEFINE_INSTANCE_ASSERTION (0*sizeof(this->u._member.static_size) + sizeof(this->u._member) == (size)); \
   static const unsigned int min_size = (size)
 
 #define DEFINE_SIZE_MIN(size) \
@@ -650,7 +650,9 @@
   DEFINE_SIZE_STATIC (Size);
 };
 
+typedef IntType<int8_t  , 1> CHAR;      /* 8-bit signed integer. */
 typedef IntType<uint8_t , 1> BYTE;      /* 8-bit unsigned integer. */
+typedef IntType<int8_t  , 1> INT8;      /* 8-bit signed integer. */
 typedef IntType<uint16_t, 2> USHORT;    /* 16-bit unsigned integer. */
 typedef IntType<int16_t,  2> SHORT;     /* 16-bit signed integer. */
 typedef IntType<uint32_t, 4> ULONG;     /* 32-bit unsigned integer. */
@@ -805,6 +807,7 @@
     if (unlikely (!c->check_struct (this))) return_trace (false);
     unsigned int offset = *this;
     if (unlikely (!offset)) return_trace (true);
+    if (unlikely (!c->check_range (base, offset))) return_trace (false);
     const Type &obj = StructAtOffset<Type> (base, offset);
     return_trace (likely (obj.sanitize (c)) || neuter (c));
   }
@@ -815,6 +818,7 @@
     if (unlikely (!c->check_struct (this))) return_trace (false);
     unsigned int offset = *this;
     if (unlikely (!offset)) return_trace (true);
+    if (unlikely (!c->check_range (base, offset))) return_trace (false);
     const Type &obj = StructAtOffset<Type> (base, offset);
     return_trace (likely (obj.sanitize (c, user_data)) || neuter (c));
   }
@@ -948,8 +952,8 @@
 };
 
 /* Array of Offset's */
-template <typename Type>
-struct OffsetArrayOf : ArrayOf<OffsetTo<Type> > {};
+template <typename Type, typename OffsetType=USHORT>
+struct OffsetArrayOf : ArrayOf<OffsetTo<Type, OffsetType> > {};
 
 /* Array of offsets relative to the beginning of the array itself. */
 template <typename Type>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-cbdt-table.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,384 @@
+/*
+ * Copyright © 2016  Google, Inc.
+ *
+ *  This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Google Author(s): Seigo Nonaka
+ */
+
+#ifndef HB_OT_CBDT_TABLE_HH
+#define HB_OT_CBDT_TABLE_HH
+
+#include "hb-open-type-private.hh"
+
+namespace OT {
+
+struct SmallGlyphMetrics
+{
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  inline void get_extents (hb_glyph_extents_t *extents) const
+  {
+    extents->x_bearing = bearingX;
+    extents->y_bearing = bearingY;
+    extents->width = width;
+    extents->height = -height;
+  }
+
+  BYTE height;
+  BYTE width;
+  CHAR bearingX;
+  CHAR bearingY;
+  BYTE advance;
+
+  DEFINE_SIZE_STATIC(5);
+};
+
+struct BigGlyphMetrics : SmallGlyphMetrics
+{
+  CHAR vertBearingX;
+  CHAR vertBearingY;
+  BYTE vertAdvance;
+
+  DEFINE_SIZE_STATIC(8);
+};
+
+struct SBitLineMetrics
+{
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  CHAR ascender;
+  CHAR decender;
+  BYTE widthMax;
+  CHAR caretSlopeNumerator;
+  CHAR caretSlopeDenominator;
+  CHAR caretOffset;
+  CHAR minOriginSB;
+  CHAR minAdvanceSB;
+  CHAR maxBeforeBL;
+  CHAR minAfterBL;
+  CHAR padding1;
+  CHAR padding2;
+
+  DEFINE_SIZE_STATIC(12);
+};
+
+
+/*
+ * Index Subtables.
+ */
+
+struct IndexSubtableHeader
+{
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  USHORT indexFormat;
+  USHORT imageFormat;
+  ULONG imageDataOffset;
+
+  DEFINE_SIZE_STATIC(8);
+};
+
+template <typename OffsetType>
+struct IndexSubtableFormat1Or3
+{
+  inline bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+		  c->check_array (offsetArrayZ, offsetArrayZ[0].static_size, glyph_count + 1));
+  }
+
+  bool get_image_data (unsigned int idx,
+		       unsigned int *offset,
+		       unsigned int *length) const
+  {
+    if (unlikely (offsetArrayZ[idx + 1] <= offsetArrayZ[idx]))
+      return false;
+
+    *offset = header.imageDataOffset + offsetArrayZ[idx];
+    *length = offsetArrayZ[idx + 1] - offsetArrayZ[idx];
+    return true;
+  }
+
+  IndexSubtableHeader header;
+  Offset<OffsetType> offsetArrayZ[VAR];
+
+  DEFINE_SIZE_ARRAY(8, offsetArrayZ);
+};
+
+struct IndexSubtableFormat1 : IndexSubtableFormat1Or3<ULONG> {};
+struct IndexSubtableFormat3 : IndexSubtableFormat1Or3<USHORT> {};
+
+struct IndexSubtable
+{
+  inline bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const
+  {
+    TRACE_SANITIZE (this);
+    if (!u.header.sanitize (c)) return_trace (false);
+    switch (u.header.indexFormat) {
+    case 1: return_trace (u.format1.sanitize (c, glyph_count));
+    case 3: return_trace (u.format3.sanitize (c, glyph_count));
+    default:return_trace (true);
+    }
+  }
+
+  inline bool get_extents (hb_glyph_extents_t *extents) const
+  {
+    switch (u.header.indexFormat) {
+    case 2: case 5: /* TODO */
+    case 1: case 3: case 4: /* Variable-metrics formats do not have metrics here. */
+    default:return (false);
+    }
+  }
+
+  bool get_image_data (unsigned int idx,
+		       unsigned int *offset,
+		       unsigned int *length,
+		       unsigned int *format) const
+  {
+    *format = u.header.imageFormat;
+    switch (u.header.indexFormat) {
+    case 1: return u.format1.get_image_data (idx, offset, length);
+    case 3: return u.format3.get_image_data (idx, offset, length);
+    default: return false;
+    }
+  }
+
+  protected:
+  union {
+  IndexSubtableHeader	header;
+  IndexSubtableFormat1	format1;
+  IndexSubtableFormat3	format3;
+  /* TODO: Format 2, 4, 5. */
+  } u;
+  public:
+  DEFINE_SIZE_UNION (8, header);
+};
+
+struct IndexSubtableRecord
+{
+  inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+		  firstGlyphIndex <= lastGlyphIndex &&
+		  offsetToSubtable.sanitize (c, this, lastGlyphIndex - firstGlyphIndex + 1));
+  }
+
+  inline bool get_extents (hb_glyph_extents_t *extents) const
+  {
+    return (this+offsetToSubtable).get_extents (extents);
+  }
+
+  bool get_image_data (unsigned int gid,
+		       unsigned int *offset,
+		       unsigned int *length,
+		       unsigned int *format) const
+  {
+    if (gid < firstGlyphIndex || gid > lastGlyphIndex)
+    {
+      return false;
+    }
+    return (this+offsetToSubtable).get_image_data (gid - firstGlyphIndex,
+						   offset, length, format);
+  }
+
+  USHORT firstGlyphIndex;
+  USHORT lastGlyphIndex;
+  OffsetTo<IndexSubtable, ULONG> offsetToSubtable;
+
+  DEFINE_SIZE_STATIC(8);
+};
+
+struct IndexSubtableArray
+{
+  inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const
+  {
+    TRACE_SANITIZE (this);
+    if (unlikely (!c->check_array (&indexSubtablesZ, indexSubtablesZ[0].static_size, count)))
+      return_trace (false);
+    for (unsigned int i = 0; i < count; i++)
+      if (unlikely (!indexSubtablesZ[i].sanitize (c, this)))
+	return_trace (false);
+    return_trace (true);
+  }
+
+  public:
+  const IndexSubtableRecord* find_table (hb_codepoint_t glyph, unsigned int numTables) const
+  {
+    for (unsigned int i = 0; i < numTables; ++i)
+    {
+      unsigned int firstGlyphIndex = indexSubtablesZ[i].firstGlyphIndex;
+      unsigned int lastGlyphIndex = indexSubtablesZ[i].lastGlyphIndex;
+      if (firstGlyphIndex <= glyph && glyph <= lastGlyphIndex) {
+        return &indexSubtablesZ[i];
+      }
+    }
+    return NULL;
+  }
+
+  protected:
+  IndexSubtableRecord indexSubtablesZ[VAR];
+
+  public:
+  DEFINE_SIZE_ARRAY(0, indexSubtablesZ);
+};
+
+struct BitmapSizeTable
+{
+  friend struct CBLC;
+
+  inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+		  indexSubtableArrayOffset.sanitize (c, base, numberOfIndexSubtables) &&
+		  c->check_range (&(base+indexSubtableArrayOffset), indexTablesSize) &&
+		  horizontal.sanitize (c) &&
+		  vertical.sanitize (c));
+  }
+
+  const IndexSubtableRecord *find_table (hb_codepoint_t glyph, const void *base) const
+  {
+    return (base+indexSubtableArrayOffset).find_table (glyph, numberOfIndexSubtables);
+  }
+
+  protected:
+  OffsetTo<IndexSubtableArray, ULONG> indexSubtableArrayOffset;
+  ULONG indexTablesSize;
+  ULONG numberOfIndexSubtables;
+  ULONG colorRef;
+  SBitLineMetrics horizontal;
+  SBitLineMetrics vertical;
+  USHORT startGlyphIndex;
+  USHORT endGlyphIndex;
+  BYTE ppemX;
+  BYTE ppemY;
+  BYTE bitDepth;
+  CHAR flags;
+
+public:
+  DEFINE_SIZE_STATIC(48);
+};
+
+
+/*
+ * Glyph Bitmap Data Formats.
+ */
+
+struct GlyphBitmapDataFormat17
+{
+  SmallGlyphMetrics glyphMetrics;
+  ULONG dataLen;
+  BYTE dataZ[VAR];
+
+  DEFINE_SIZE_ARRAY(9, dataZ);
+};
+
+
+/*
+ * CBLC -- Color Bitmap Location Table
+ */
+
+#define HB_OT_TAG_CBLC HB_TAG('C','B','L','C')
+
+struct CBLC
+{
+  static const hb_tag_t tableTag = HB_OT_TAG_CBLC;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+		  likely (version.major == 2 || version.major == 3) &&
+		  sizeTables.sanitize (c, this));
+  }
+
+  public:
+  const IndexSubtableRecord *find_table (hb_codepoint_t glyph,
+					 unsigned int *x_ppem, unsigned int *y_ppem) const
+  {
+    /* TODO: Make it possible to select strike. */
+
+    unsigned int count = sizeTables.len;
+    for (uint32_t i = 0; i < count; ++i)
+    {
+      unsigned int startGlyphIndex = sizeTables.array[i].startGlyphIndex;
+      unsigned int endGlyphIndex = sizeTables.array[i].endGlyphIndex;
+      if (startGlyphIndex <= glyph && glyph <= endGlyphIndex)
+      {
+	*x_ppem = sizeTables[i].ppemX;
+	*y_ppem = sizeTables[i].ppemY;
+	return sizeTables[i].find_table (glyph, this);
+      }
+    }
+
+    return NULL;
+  }
+
+  protected:
+  FixedVersion<>version;
+  ArrayOf<BitmapSizeTable, ULONG> sizeTables;
+
+  public:
+  DEFINE_SIZE_ARRAY(8, sizeTables);
+};
+
+/*
+ * CBDT -- Color Bitmap Data Table
+ */
+#define HB_OT_TAG_CBDT HB_TAG('C','B','D','T')
+
+struct CBDT
+{
+  static const hb_tag_t tableTag = HB_OT_TAG_CBDT;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+		  likely (version.major == 2 || version.major == 3));
+  }
+
+  protected:
+  FixedVersion<>version;
+  BYTE dataZ[VAR];
+
+  public:
+  DEFINE_SIZE_ARRAY(4, dataZ);
+};
+
+} /* namespace OT */
+
+#endif /* HB_OT_CBDT_TABLE_HH */
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-font.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-font.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -31,6 +31,7 @@
 #include "hb-font-private.hh"
 
 #include "hb-ot-cmap-table.hh"
+#include "hb-ot-cbdt-table.hh"
 #include "hb-ot-glyf-table.hh"
 #include "hb-ot-head-table.hh"
 #include "hb-ot-hhea-table.hh"
@@ -47,6 +48,7 @@
   unsigned short ascender;
   unsigned short descender;
   unsigned short line_gap;
+  bool has_font_extents;
 
   const OT::_mtx *table;
   hb_blob_t *blob;
@@ -54,9 +56,10 @@
   inline void init (hb_face_t *face,
                     hb_tag_t _hea_tag,
                     hb_tag_t _mtx_tag,
-                    hb_tag_t os2_tag)
+                    hb_tag_t os2_tag,
+                    unsigned int default_advance = 0)
   {
-    this->default_advance = face->get_upem ();
+    this->default_advance = default_advance ? default_advance : face->get_upem ();
 
     bool got_font_extents = false;
     if (os2_tag)
@@ -82,9 +85,12 @@
       this->ascender = _hea->ascender;
       this->descender = _hea->descender;
       this->line_gap = _hea->lineGap;
+      got_font_extents = (this->ascender | this->descender) != 0;
     }
     hb_blob_destroy (_hea_blob);
 
+    this->has_font_extents = got_font_extents;
+
     this->blob = OT::Sanitizer<OT::_mtx>::sanitize (face->reference_table (_mtx_tag));
 
     /* Cap num_metrics() and num_advances() based on table length. */
@@ -202,6 +208,91 @@
   }
 };
 
+struct hb_ot_face_cbdt_accelerator_t
+{
+  hb_blob_t *cblc_blob;
+  hb_blob_t *cbdt_blob;
+  const OT::CBLC *cblc;
+  const OT::CBDT *cbdt;
+
+  unsigned int cbdt_len;
+  float upem;
+
+  inline void init (hb_face_t *face)
+  {
+    upem = face->get_upem();
+
+    cblc_blob = OT::Sanitizer<OT::CBLC>::sanitize (face->reference_table (HB_OT_TAG_CBLC));
+    cbdt_blob = OT::Sanitizer<OT::CBDT>::sanitize (face->reference_table (HB_OT_TAG_CBDT));
+    cbdt_len = hb_blob_get_length (cbdt_blob);
+
+    if (hb_blob_get_length (cblc_blob) == 0) {
+      cblc = NULL;
+      cbdt = NULL;
+      return;  /* Not a bitmap font. */
+    }
+    cblc = OT::Sanitizer<OT::CBLC>::lock_instance (cblc_blob);
+    cbdt = OT::Sanitizer<OT::CBDT>::lock_instance (cbdt_blob);
+
+  }
+
+  inline void fini (void)
+  {
+    hb_blob_destroy (this->cblc_blob);
+    hb_blob_destroy (this->cbdt_blob);
+  }
+
+  inline bool get_extents (hb_codepoint_t glyph, hb_glyph_extents_t *extents) const
+  {
+    unsigned int x_ppem = upem, y_ppem = upem; /* TODO Use font ppem if available. */
+
+    if (cblc == NULL)
+      return false;  // Not a color bitmap font.
+
+    const OT::IndexSubtableRecord *subtable_record = this->cblc->find_table(glyph, &x_ppem, &y_ppem);
+    if (subtable_record == NULL)
+      return false;
+
+    if (subtable_record->get_extents (extents))
+      return true;
+
+    unsigned int image_offset = 0, image_length = 0, image_format = 0;
+    if (!subtable_record->get_image_data (glyph, &image_offset, &image_length, &image_format))
+      return false;
+
+    {
+      /* TODO Move the following into CBDT struct when adding more formats. */
+
+      if (unlikely (image_offset > cbdt_len || cbdt_len - image_offset < image_length))
+        return false;
+
+      switch (image_format)
+      {
+        case 17: {
+          if (unlikely (image_length < OT::GlyphBitmapDataFormat17::min_size))
+            return false;
+
+          const OT::GlyphBitmapDataFormat17& glyphFormat17 =
+              OT::StructAtOffset<OT::GlyphBitmapDataFormat17> (this->cbdt, image_offset);
+          glyphFormat17.glyphMetrics.get_extents (extents);
+        }
+        break;
+        default:
+          // TODO: Support other image formats.
+          return false;
+      }
+    }
+
+    /* Convert to the font units. */
+    extents->x_bearing *= upem / (float) x_ppem;
+    extents->y_bearing *= upem / (float) y_ppem;
+    extents->width *= upem / (float) x_ppem;
+    extents->height *= upem / (float) y_ppem;
+
+    return true;
+  }
+};
+
 typedef bool (*hb_cmap_get_glyph_func_t) (const void *obj,
                                           hb_codepoint_t codepoint,
                                           hb_codepoint_t *glyph);
@@ -264,7 +355,11 @@
     if (!subtable) subtable = cmap->find_subtable (0, 2);
     if (!subtable) subtable = cmap->find_subtable (0, 1);
     if (!subtable) subtable = cmap->find_subtable (0, 0);
-    if (!subtable)(subtable = cmap->find_subtable (3, 0)) && (symbol = true);
+    if (!subtable)
+    {
+      subtable = cmap->find_subtable (3, 0);
+      if (subtable) symbol = true;
+    }
     /* Meh. */
     if (!subtable) subtable = &OT::Null(OT::CmapSubtable);
 
@@ -374,6 +469,7 @@
   hb_ot_face_metrics_accelerator_t h_metrics;
   hb_ot_face_metrics_accelerator_t v_metrics;
   hb_lazy_loader_t<hb_ot_face_glyf_accelerator_t> glyf;
+  hb_lazy_loader_t<hb_ot_face_cbdt_accelerator_t> cbdt;
 };
 
 
@@ -387,8 +483,10 @@
 
   ot_font->cmap.init (face);
   ot_font->h_metrics.init (face, HB_OT_TAG_hhea, HB_OT_TAG_hmtx, HB_OT_TAG_os2);
-  ot_font->v_metrics.init (face, HB_OT_TAG_vhea, HB_OT_TAG_vmtx, HB_TAG_NONE); /* TODO Can we do this lazily? */
+  ot_font->v_metrics.init (face, HB_OT_TAG_vhea, HB_OT_TAG_vmtx, HB_TAG_NONE,
+                           ot_font->h_metrics.ascender - ot_font->h_metrics.descender); /* TODO Can we do this lazily? */
   ot_font->glyf.init (face);
+  ot_font->cbdt.init (face);
 
   return ot_font;
 }
@@ -400,6 +498,7 @@
   ot_font->h_metrics.fini ();
   ot_font->v_metrics.fini ();
   ot_font->glyf.fini ();
+  ot_font->cbdt.fini ();
 
   free (ot_font);
 }
@@ -458,6 +557,8 @@
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
   bool ret = ot_font->glyf->get_extents (glyph, extents);
+  if (!ret)
+    ret = ot_font->cbdt->get_extents (glyph, extents);
   extents->x_bearing = font->em_scale_x (extents->x_bearing);
   extents->y_bearing = font->em_scale_y (extents->y_bearing);
   extents->width     = font->em_scale_x (extents->width);
@@ -475,7 +576,7 @@
   metrics->ascender = font->em_scale_y (ot_font->h_metrics.ascender);
   metrics->descender = font->em_scale_y (ot_font->h_metrics.descender);
   metrics->line_gap = font->em_scale_y (ot_font->h_metrics.line_gap);
-  return true;
+  return ot_font->h_metrics.has_font_extents;
 }
 
 static hb_bool_t
@@ -488,7 +589,7 @@
   metrics->ascender = font->em_scale_x (ot_font->v_metrics.ascender);
   metrics->descender = font->em_scale_x (ot_font->v_metrics.descender);
   metrics->line_gap = font->em_scale_x (ot_font->v_metrics.line_gap);
-  return true;
+  return ot_font->v_metrics.has_font_extents;
 }
 
 static hb_font_funcs_t *static_ot_funcs = NULL;
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-common-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-common-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -507,7 +507,7 @@
   { return this+featureParams; }
 
   inline bool sanitize (hb_sanitize_context_t *c,
-                        const Record<Feature>::sanitize_closure_t *closure) const
+                        const Record<Feature>::sanitize_closure_t *closure = NULL) const
   {
     TRACE_SANITIZE (this);
     if (unlikely (!(c->check_struct (this) && lookupIndex.sanitize (c))))
@@ -731,8 +731,8 @@
     inline void init (const struct CoverageFormat1 &c_) { c = &c_; i = 0; };
     inline bool more (void) { return i < c->glyphArray.len; }
     inline void next (void) { i++; }
-    inline uint16_t get_glyph (void) { return c->glyphArray[i]; }
-    inline uint16_t get_coverage (void) { return i; }
+    inline hb_codepoint_t get_glyph (void) { return c->glyphArray[i]; }
+    inline unsigned int get_coverage (void) { return i; }
 
     private:
     const struct CoverageFormat1 *c;
@@ -829,26 +829,33 @@
 
   public:
   /* Older compilers need this to be public. */
-  struct Iter {
-    inline void init (const CoverageFormat2 &c_) {
+  struct Iter
+  {
+    inline void init (const CoverageFormat2 &c_)
+    {
       c = &c_;
       coverage = 0;
       i = 0;
       j = c->rangeRecord.len ? c_.rangeRecord[0].start : 0;
     }
     inline bool more (void) { return i < c->rangeRecord.len; }
-    inline void next (void) {
-      coverage++;
-      if (j == c->rangeRecord[i].end) {
+    inline void next (void)
+    {
+      if (j >= c->rangeRecord[i].end)
+      {
         i++;
         if (more ())
+        {
           j = c->rangeRecord[i].start;
+          coverage = c->rangeRecord[i].value;
+        }
         return;
       }
+      coverage++;
       j++;
     }
-    inline uint16_t get_glyph (void) { return j; }
-    inline uint16_t get_coverage (void) { return coverage; }
+    inline hb_codepoint_t get_glyph (void) { return j; }
+    inline unsigned int get_coverage (void) { return coverage; }
 
     private:
     const struct CoverageFormat2 *c;
@@ -957,14 +964,14 @@
       default:                   break;
       }
     }
-    inline uint16_t get_glyph (void) {
+    inline hb_codepoint_t get_glyph (void) {
       switch (format) {
       case 1: return u.format1.get_glyph ();
       case 2: return u.format2.get_glyph ();
       default:return 0;
       }
     }
-    inline uint16_t get_coverage (void) {
+    inline unsigned int get_coverage (void) {
       switch (format) {
       case 1: return u.format1.get_coverage ();
       case 2: return u.format2.get_coverage ();
@@ -1162,11 +1169,380 @@
 
 
 /*
+ * Item Variation Store
+ */
+
+struct VarRegionAxis
+{
+  inline float evaluate (int coord) const
+  {
+    int start = startCoord, peak = peakCoord, end = endCoord;
+
+    /* TODO Move these to sanitize(). */
+    if (unlikely (start > peak || peak > end))
+      return 1.;
+    if (unlikely (start < 0 && end > 0 && peak != 0))
+      return 1.;
+
+    if (peak == 0 || coord == peak)
+      return 1.;
+
+    if (coord <= start || end <= coord)
+      return 0.;
+
+    /* Interpolate */
+    if (coord < peak)
+      return float (coord - start) / (peak - start);
+    else
+      return float (end - coord) / (end - peak);
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+    /* TODO Handle invalid start/peak/end configs, so we don't
+     * have to do that at runtime. */
+  }
+
+  public:
+  F2DOT14       startCoord;
+  F2DOT14       peakCoord;
+  F2DOT14       endCoord;
+  public:
+  DEFINE_SIZE_STATIC (6);
+};
+
+struct VarRegionList
+{
+  inline float evaluate (unsigned int region_index,
+                         int *coords, unsigned int coord_len) const
+  {
+    if (unlikely (region_index >= regionCount))
+      return 0.;
+
+    const VarRegionAxis *axes = axesZ + (region_index * axisCount);
+
+    float v = 1.;
+    unsigned int count = MIN (coord_len, (unsigned int) axisCount);
+    for (unsigned int i = 0; i < count; i++)
+    {
+      float factor = axes[i].evaluate (coords[i]);
+      if (factor == 0.)
+        return 0.;
+      v *= factor;
+    }
+    return v;
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+                  c->check_array (axesZ, axesZ[0].static_size,
+                                  (unsigned int) axisCount * (unsigned int) regionCount));
+  }
+
+  protected:
+  USHORT        axisCount;
+  USHORT        regionCount;
+  VarRegionAxis axesZ[VAR];
+  public:
+  DEFINE_SIZE_ARRAY (4, axesZ);
+};
+
+struct VarData
+{
+  inline unsigned int get_row_size (void) const
+  { return shortCount + regionIndices.len; }
+
+  inline unsigned int get_size (void) const
+  { return itemCount * get_row_size (); }
+
+  inline float get_delta (unsigned int inner,
+                          int *coords, unsigned int coord_count,
+                          const VarRegionList &regions) const
+  {
+    if (unlikely (inner >= itemCount))
+      return 0.;
+
+   unsigned int count = regionIndices.len;
+   unsigned int scount = shortCount;
+
+   const BYTE *bytes = &StructAfter<BYTE> (regionIndices);
+   const BYTE *row = bytes + inner * (scount + count);
+
+   float delta = 0.;
+   unsigned int i = 0;
+
+   const SHORT *scursor = reinterpret_cast<const SHORT *> (row);
+   for (; i < scount; i++)
+   {
+     float scalar = regions.evaluate (regionIndices.array[i], coords, coord_count);
+     delta += scalar * *scursor++;
+   }
+   const INT8 *bcursor = reinterpret_cast<const INT8 *> (scursor);
+   for (; i < count; i++)
+   {
+     float scalar = regions.evaluate (regionIndices.array[i], coords, coord_count);
+     delta += scalar * *bcursor++;
+   }
+
+   return delta;
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+                  regionIndices.sanitize(c) &&
+                  shortCount <= regionIndices.len &&
+                  c->check_array (&StructAfter<BYTE> (regionIndices),
+                                  get_row_size (), itemCount));
+  }
+
+  protected:
+  USHORT                itemCount;
+  USHORT                shortCount;
+  ArrayOf<USHORT>       regionIndices;
+  BYTE                  bytesX[VAR];
+  public:
+  DEFINE_SIZE_ARRAY2 (6, regionIndices, bytesX);
+};
+
+struct VariationStore
+{
+  inline float get_delta (unsigned int outer, unsigned int inner,
+                          int *coords, unsigned int coord_count) const
+  {
+    if (unlikely (outer >= dataSets.len))
+      return 0.;
+
+    return (this+dataSets[outer]).get_delta (inner,
+                                             coords, coord_count,
+                                             this+regions);
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+                  format == 1 &&
+                  regions.sanitize (c, this) &&
+                  dataSets.sanitize (c, this));
+  }
+
+  protected:
+  USHORT                                format;
+  OffsetTo<VarRegionList, ULONG>        regions;
+  OffsetArrayOf<VarData, ULONG>         dataSets;
+  public:
+  DEFINE_SIZE_ARRAY (8, dataSets);
+};
+
+/*
+ * Feature Variations
+ */
+
+struct ConditionFormat1
+{
+  friend struct Condition;
+
+  private:
+  inline bool evaluate (const int *coords, unsigned int coord_len) const
+  {
+    int coord = axisIndex < coord_len ? coords[axisIndex] : 0;
+    return filterRangeMinValue <= coord && coord <= filterRangeMaxValue;
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  protected:
+  USHORT        format;         /* Format identifier--format = 1 */
+  USHORT        axisIndex;
+  F2DOT14       filterRangeMinValue;
+  F2DOT14       filterRangeMaxValue;
+  public:
+  DEFINE_SIZE_STATIC (8);
+};
+
+struct Condition
+{
+  inline bool evaluate (const int *coords, unsigned int coord_len) const
+  {
+    switch (u.format) {
+    case 1: return u.format1.evaluate (coords, coord_len);
+    default:return false;
+    }
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    if (!u.format.sanitize (c)) return_trace (false);
+    switch (u.format) {
+    case 1: return_trace (u.format1.sanitize (c));
+    default:return_trace (true);
+    }
+  }
+
+  protected:
+  union {
+  USHORT                format;         /* Format identifier */
+  ConditionFormat1      format1;
+  } u;
+  public:
+  DEFINE_SIZE_UNION (2, format);
+};
+
+struct ConditionSet
+{
+  inline bool evaluate (const int *coords, unsigned int coord_len) const
+  {
+    unsigned int count = conditions.len;
+    for (unsigned int i = 0; i < count; i++)
+      if (!(this+conditions.array[i]).evaluate (coords, coord_len))
+        return false;
+    return true;
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (conditions.sanitize (c, this));
+  }
+
+  protected:
+  OffsetArrayOf<Condition, ULONG> conditions;
+  public:
+  DEFINE_SIZE_ARRAY (2, conditions);
+};
+
+struct FeatureTableSubstitutionRecord
+{
+  friend struct FeatureTableSubstitution;
+
+  inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) && feature.sanitize (c, base));
+  }
+
+  protected:
+  USHORT                        featureIndex;
+  OffsetTo<Feature, ULONG>      feature;
+  public:
+  DEFINE_SIZE_STATIC (6);
+};
+
+struct FeatureTableSubstitution
+{
+  inline const Feature *find_substitute (unsigned int feature_index) const
+  {
+    unsigned int count = substitutions.len;
+    for (unsigned int i = 0; i < count; i++)
+    {
+      const FeatureTableSubstitutionRecord &record = substitutions.array[i];
+      if (record.featureIndex == feature_index)
+        return &(this+record.feature);
+    }
+    return NULL;
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (version.sanitize (c) &&
+                  likely (version.major == 1) &&
+                  substitutions.sanitize (c, this));
+  }
+
+  protected:
+  FixedVersion<>        version;        /* Version--0x00010000u */
+  ArrayOf<FeatureTableSubstitutionRecord>
+                        substitutions;
+  public:
+  DEFINE_SIZE_ARRAY (6, substitutions);
+};
+
+struct FeatureVariationRecord
+{
+  friend struct FeatureVariations;
+
+  inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (conditions.sanitize (c, base) &&
+                  substitutions.sanitize (c, base));
+  }
+
+  protected:
+  OffsetTo<ConditionSet, ULONG>
+                        conditions;
+  OffsetTo<FeatureTableSubstitution, ULONG>
+                        substitutions;
+  public:
+  DEFINE_SIZE_STATIC (8);
+};
+
+struct FeatureVariations
+{
+  static const unsigned int NOT_FOUND_INDEX = 0xFFFFFFFFu;
+
+  inline bool find_index (const int *coords, unsigned int coord_len,
+                          unsigned int *index) const
+  {
+    unsigned int count = varRecords.len;
+    for (unsigned int i = 0; i < count; i++)
+    {
+      const FeatureVariationRecord &record = varRecords.array[i];
+      if ((this+record.conditions).evaluate (coords, coord_len))
+      {
+        *index = i;
+        return true;
+      }
+    }
+    *index = NOT_FOUND_INDEX;
+    return false;
+  }
+
+  inline const Feature *find_substitute (unsigned int variations_index,
+                                         unsigned int feature_index) const
+  {
+    const FeatureVariationRecord &record = varRecords[variations_index];
+    return (this+record.substitutions).find_substitute (feature_index);
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (version.sanitize (c) &&
+                  likely (version.major == 1) &&
+                  varRecords.sanitize (c, this));
+  }
+
+  protected:
+  FixedVersion<>        version;        /* Version--0x00010000u */
+  ArrayOf<FeatureVariationRecord, ULONG>
+                        varRecords;
+  public:
+  DEFINE_SIZE_ARRAY (8, varRecords);
+};
+
+
+/*
  * Device Tables
  */
 
-struct Device
+struct HintingDevice
 {
+  friend struct Device;
+
+  private:
 
   inline hb_position_t get_x_delta (hb_font_t *font) const
   { return get_delta (font->x_ppem, font->x_scale); }
@@ -1235,6 +1611,101 @@
   DEFINE_SIZE_ARRAY (6, deltaValue);
 };
 
+struct VariationDevice
+{
+  friend struct Device;
+
+  private:
+
+  inline hb_position_t get_x_delta (hb_font_t *font, const VariationStore &store) const
+  { return font->em_scalef_x (get_delta (font, store)); }
+
+  inline hb_position_t get_y_delta (hb_font_t *font, const VariationStore &store) const
+  { return font->em_scalef_y (get_delta (font, store)); }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  private:
+
+  inline float get_delta (hb_font_t *font, const VariationStore &store) const
+  {
+    return store.get_delta (outerIndex, innerIndex, font->coords, font->num_coords);
+  }
+
+  protected:
+  USHORT        outerIndex;
+  USHORT        innerIndex;
+  USHORT        deltaFormat;    /* Format identifier for this table: 0x0x8000 */
+  public:
+  DEFINE_SIZE_STATIC (6);
+};
+
+struct DeviceHeader
+{
+  protected:
+  USHORT                reserved1;
+  USHORT                reserved2;
+  public:
+  USHORT                format;         /* Format identifier */
+  public:
+  DEFINE_SIZE_STATIC (6);
+};
+
+struct Device
+{
+  inline hb_position_t get_x_delta (hb_font_t *font, const VariationStore &store=Null(VariationStore)) const
+  {
+    switch (u.b.format)
+    {
+    case 1: case 2: case 3:
+      return u.hinting.get_x_delta (font);
+    case 0x8000:
+      return u.variation.get_x_delta (font, store);
+    default:
+      return 0;
+    }
+  }
+  inline hb_position_t get_y_delta (hb_font_t *font, const VariationStore &store=Null(VariationStore)) const
+  {
+    switch (u.b.format)
+    {
+    case 1: case 2: case 3:
+      return u.hinting.get_y_delta (font);
+    case 0x8000:
+      return u.variation.get_y_delta (font, store);
+    default:
+      return 0;
+    }
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    if (!u.b.format.sanitize (c)) return_trace (false);
+    switch (u.b.format) {
+    case 1: case 2: case 3:
+      return_trace (u.hinting.sanitize (c));
+    case 0x8000:
+      return_trace (u.variation.sanitize (c));
+    default:
+      return_trace (true);
+    }
+  }
+
+  protected:
+  union {
+  DeviceHeader          b;
+  HintingDevice         hinting;
+  VariationDevice       variation;
+  } u;
+  public:
+  DEFINE_SIZE_UNION (6, b);
+};
+
 
 } /* namespace OT */
 
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gdef-table.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gdef-table.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -97,7 +97,7 @@
   friend struct CaretValue;
 
   private:
-  inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id HB_UNUSED) const
+  inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction) const
   {
     return HB_DIRECTION_IS_HORIZONTAL (direction) ? font->em_scale_x (coordinate) : font->em_scale_y (coordinate);
   }
@@ -146,11 +146,11 @@
 {
   friend struct CaretValue;
 
-  inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id HB_UNUSED) const
+  inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, const VariationStore &var_store) const
   {
     return HB_DIRECTION_IS_HORIZONTAL (direction) ?
-           font->em_scale_x (coordinate) + (this+deviceTable).get_x_delta (font) :
-           font->em_scale_y (coordinate) + (this+deviceTable).get_y_delta (font);
+           font->em_scale_x (coordinate) + (this+deviceTable).get_x_delta (font, var_store) :
+           font->em_scale_y (coordinate) + (this+deviceTable).get_y_delta (font, var_store);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
@@ -172,12 +172,15 @@
 
 struct CaretValue
 {
-  inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id) const
+  inline hb_position_t get_caret_value (hb_font_t *font,
+                                        hb_direction_t direction,
+                                        hb_codepoint_t glyph_id,
+                                        const VariationStore &var_store) const
   {
     switch (u.format) {
-    case 1: return u.format1.get_caret_value (font, direction, glyph_id);
+    case 1: return u.format1.get_caret_value (font, direction);
     case 2: return u.format2.get_caret_value (font, direction, glyph_id);
-    case 3: return u.format3.get_caret_value (font, direction, glyph_id);
+    case 3: return u.format3.get_caret_value (font, direction, var_store);
     default:return 0;
     }
   }
@@ -210,6 +213,7 @@
   inline unsigned int get_lig_carets (hb_font_t *font,
                                       hb_direction_t direction,
                                       hb_codepoint_t glyph_id,
+                                      const VariationStore &var_store,
                                       unsigned int start_offset,
                                       unsigned int *caret_count /* IN/OUT */,
                                       hb_position_t *caret_array /* OUT */) const
@@ -218,7 +222,7 @@
       const OffsetTo<CaretValue> *array = carets.sub_array (start_offset, caret_count);
       unsigned int count = *caret_count;
       for (unsigned int i = 0; i < count; i++)
-        caret_array[i] = (this+array[i]).get_caret_value (font, direction, glyph_id);
+        caret_array[i] = (this+array[i]).get_caret_value (font, direction, glyph_id, var_store);
     }
 
     return carets.len;
@@ -244,6 +248,7 @@
   inline unsigned int get_lig_carets (hb_font_t *font,
                                       hb_direction_t direction,
                                       hb_codepoint_t glyph_id,
+                                      const VariationStore &var_store,
                                       unsigned int start_offset,
                                       unsigned int *caret_count /* IN/OUT */,
                                       hb_position_t *caret_array /* OUT */) const
@@ -256,7 +261,7 @@
       return 0;
     }
     const LigGlyph &lig_glyph = this+ligGlyph[index];
-    return lig_glyph.get_lig_carets (font, direction, glyph_id, start_offset, caret_count, caret_array);
+    return lig_glyph.get_lig_carets (font, direction, glyph_id, var_store, start_offset, caret_count, caret_array);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
@@ -367,11 +372,17 @@
                                       unsigned int start_offset,
                                       unsigned int *caret_count /* IN/OUT */,
                                       hb_position_t *caret_array /* OUT */) const
-  { return (this+ligCaretList).get_lig_carets (font, direction, glyph_id, start_offset, caret_count, caret_array); }
+  { return (this+ligCaretList).get_lig_carets (font,
+                                               direction, glyph_id, get_var_store(),
+                                               start_offset, caret_count, caret_array); }
 
-  inline bool has_mark_sets (void) const { return version.to_int () >= 0x00010002u && markGlyphSetsDef[0] != 0; }
+  inline bool has_mark_sets (void) const { return version.to_int () >= 0x00010002u && markGlyphSetsDef != 0; }
   inline bool mark_set_covers (unsigned int set_index, hb_codepoint_t glyph_id) const
-  { return version.to_int () >= 0x00010002u && (this+markGlyphSetsDef[0]).covers (set_index, glyph_id); }
+  { return version.to_int () >= 0x00010002u && (this+markGlyphSetsDef).covers (set_index, glyph_id); }
+
+  inline bool has_var_store (void) const { return version.to_int () >= 0x00010003u && varStore != 0; }
+  inline const VariationStore &get_var_store (void) const
+  { return version.to_int () >= 0x00010003u ? this+varStore : Null(VariationStore); }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
@@ -382,10 +393,10 @@
                   attachList.sanitize (c, this) &&
                   ligCaretList.sanitize (c, this) &&
                   markAttachClassDef.sanitize (c, this) &&
-                  (version.to_int () < 0x00010002u || markGlyphSetsDef[0].sanitize (c, this)));
+                  (version.to_int () < 0x00010002u || markGlyphSetsDef.sanitize (c, this)) &&
+                  (version.to_int () < 0x00010003u || varStore.sanitize (c, this)));
   }
 
-
   /* glyph_props is a 16-bit integer where the lower 8-bit have bits representing
    * glyph class and other bits, and high 8-bit gthe mark attachment type (if any).
    * Not to be confused with lookup_props which is very similar. */
@@ -410,7 +421,7 @@
 
   protected:
   FixedVersion<>version;                /* Version of the GDEF table--currently
-                                         * 0x00010002u */
+                                         * 0x00010003u */
   OffsetTo<ClassDef>
                 glyphClassDef;          /* Offset to class definition table
                                          * for glyph type--from beginning of
@@ -428,12 +439,17 @@
                                          * mark attachment type--from beginning
                                          * of GDEF header (may be Null) */
   OffsetTo<MarkGlyphSets>
-                markGlyphSetsDef[VAR];  /* Offset to the table of mark set
+                markGlyphSetsDef;       /* Offset to the table of mark set
                                          * definitions--from beginning of GDEF
                                          * header (may be NULL).  Introduced
-                                         * in version 00010002. */
+                                         * in version 0x00010002. */
+  OffsetTo<VariationStore, ULONG>
+                varStore;               /* Offset to the table of Item Variation
+                                         * Store--from beginning of GDEF
+                                         * header (may be NULL).  Introduced
+                                         * in version 0x00010003. */
   public:
-  DEFINE_SIZE_ARRAY (12, markGlyphSetsDef);
+  DEFINE_SIZE_MIN (12);
 };
 
 
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gpos-table.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gpos-table.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -103,17 +103,16 @@
   inline unsigned int get_size (void) const
   { return get_len () * Value::static_size; }
 
-  void apply_value (hb_font_t            *font,
-                    hb_direction_t        direction,
+  void apply_value (hb_apply_context_t   *c,
                     const void           *base,
                     const Value          *values,
                     hb_glyph_position_t  &glyph_pos) const
   {
-    unsigned int x_ppem, y_ppem;
     unsigned int format = *this;
-    hb_bool_t horizontal = HB_DIRECTION_IS_HORIZONTAL (direction);
+    if (!format) return;
 
-    if (!format) return;
+    hb_font_t *font = c->font;
+    hb_bool_t horizontal = HB_DIRECTION_IS_HORIZONTAL (c->direction);
 
     if (format & xPlacement) glyph_pos.x_offset  += font->em_scale_x (get_short (values++));
     if (format & yPlacement) glyph_pos.y_offset  += font->em_scale_y (get_short (values++));
@@ -129,27 +128,29 @@
 
     if (!has_device ()) return;
 
-    x_ppem = font->x_ppem;
-    y_ppem = font->y_ppem;
+    bool use_x_device = font->x_ppem || font->num_coords;
+    bool use_y_device = font->y_ppem || font->num_coords;
 
-    if (!x_ppem && !y_ppem) return;
+    if (!use_x_device && !use_y_device) return;
+
+    const VariationStore &store = c->var_store;
 
     /* pixel -> fractional pixel */
     if (format & xPlaDevice) {
-      if (x_ppem) glyph_pos.x_offset  += (base + get_device (values)).get_x_delta (font);
+      if (use_x_device) glyph_pos.x_offset  += (base + get_device (values)).get_x_delta (font, store);
       values++;
     }
     if (format & yPlaDevice) {
-      if (y_ppem) glyph_pos.y_offset  += (base + get_device (values)).get_y_delta (font);
+      if (use_y_device) glyph_pos.y_offset  += (base + get_device (values)).get_y_delta (font, store);
       values++;
     }
     if (format & xAdvDevice) {
-      if (horizontal && x_ppem) glyph_pos.x_advance += (base + get_device (values)).get_x_delta (font);
+      if (horizontal && use_x_device) glyph_pos.x_advance += (base + get_device (values)).get_x_delta (font, store);
       values++;
     }
     if (format & yAdvDevice) {
       /* y_advance values grow downward but font-space grows upward, hence negation */
-      if (!horizontal && y_ppem) glyph_pos.y_advance -= (base + get_device (values)).get_y_delta (font);
+      if (!horizontal && use_y_device) glyph_pos.y_advance -= (base + get_device (values)).get_y_delta (font, store);
       values++;
     }
   }
@@ -231,11 +232,12 @@
 
 struct AnchorFormat1
 {
-  inline void get_anchor (hb_font_t *font, hb_codepoint_t glyph_id HB_UNUSED,
+  inline void get_anchor (hb_apply_context_t *c, hb_codepoint_t glyph_id HB_UNUSED,
                           hb_position_t *x, hb_position_t *y) const
   {
-      *x = font->em_scale_x (xCoordinate);
-      *y = font->em_scale_y (yCoordinate);
+    hb_font_t *font = c->font;
+    *x = font->em_scale_x (xCoordinate);
+    *y = font->em_scale_y (yCoordinate);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
@@ -254,18 +256,19 @@
 
 struct AnchorFormat2
 {
-  inline void get_anchor (hb_font_t *font, hb_codepoint_t glyph_id,
+  inline void get_anchor (hb_apply_context_t *c, hb_codepoint_t glyph_id,
                           hb_position_t *x, hb_position_t *y) const
   {
-      unsigned int x_ppem = font->x_ppem;
-      unsigned int y_ppem = font->y_ppem;
-      hb_position_t cx, cy;
-      hb_bool_t ret;
+    hb_font_t *font = c->font;
+    unsigned int x_ppem = font->x_ppem;
+    unsigned int y_ppem = font->y_ppem;
+    hb_position_t cx, cy;
+    hb_bool_t ret;
 
-      ret = (x_ppem || y_ppem) &&
-             font->get_glyph_contour_point_for_origin (glyph_id, anchorPoint, HB_DIRECTION_LTR, &cx, &cy);
-      *x = ret && x_ppem ? cx : font->em_scale_x (xCoordinate);
-      *y = ret && y_ppem ? cy : font->em_scale_y (yCoordinate);
+    ret = (x_ppem || y_ppem) &&
+           font->get_glyph_contour_point_for_origin (glyph_id, anchorPoint, HB_DIRECTION_LTR, &cx, &cy);
+    *x = ret && x_ppem ? cx : font->em_scale_x (xCoordinate);
+    *y = ret && y_ppem ? cy : font->em_scale_y (yCoordinate);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
@@ -285,16 +288,17 @@
 
 struct AnchorFormat3
 {
-  inline void get_anchor (hb_font_t *font, hb_codepoint_t glyph_id HB_UNUSED,
+  inline void get_anchor (hb_apply_context_t *c, hb_codepoint_t glyph_id HB_UNUSED,
                           hb_position_t *x, hb_position_t *y) const
   {
-      *x = font->em_scale_x (xCoordinate);
-      *y = font->em_scale_y (yCoordinate);
+    hb_font_t *font = c->font;
+    *x = font->em_scale_x (xCoordinate);
+    *y = font->em_scale_y (yCoordinate);
 
-      if (font->x_ppem)
-        *x += (this+xDeviceTable).get_x_delta (font);
-      if (font->y_ppem)
-        *y += (this+yDeviceTable).get_x_delta (font);
+    if (font->x_ppem || font->num_coords)
+      *x += (this+xDeviceTable).get_x_delta (font, c->var_store);
+    if (font->y_ppem || font->num_coords)
+      *y += (this+yDeviceTable).get_y_delta (font, c->var_store);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
@@ -321,14 +325,14 @@
 
 struct Anchor
 {
-  inline void get_anchor (hb_font_t *font, hb_codepoint_t glyph_id,
+  inline void get_anchor (hb_apply_context_t *c, hb_codepoint_t glyph_id,
                           hb_position_t *x, hb_position_t *y) const
   {
     *x = *y = 0;
     switch (u.format) {
-    case 1: u.format1.get_anchor (font, glyph_id, x, y); return;
-    case 2: u.format2.get_anchor (font, glyph_id, x, y); return;
-    case 3: u.format3.get_anchor (font, glyph_id, x, y); return;
+    case 1: u.format1.get_anchor (c, glyph_id, x, y); return;
+    case 2: u.format2.get_anchor (c, glyph_id, x, y); return;
+    case 3: u.format3.get_anchor (c, glyph_id, x, y); return;
     default:                                             return;
     }
   }
@@ -370,7 +374,7 @@
   {
     TRACE_SANITIZE (this);
     if (!c->check_struct (this)) return_trace (false);
-    if (unlikely (rows > 0 && cols >= ((unsigned int) -1) / rows)) return_trace (false);
+    if (unlikely (_hb_unsigned_int_mul_overflows (rows, cols))) return_trace (false);
     unsigned int count = rows * cols;
     if (!c->check_array (matrixZ, matrixZ[0].static_size, count)) return_trace (false);
     for (unsigned int i = 0; i < count; i++)
@@ -428,8 +432,8 @@
 
     hb_position_t mark_x, mark_y, base_x, base_y;
 
-    mark_anchor.get_anchor (c->font, buffer->cur().codepoint, &mark_x, &mark_y);
-    glyph_anchor.get_anchor (c->font, buffer->info[glyph_pos].codepoint, &base_x, &base_y);
+    mark_anchor.get_anchor (c, buffer->cur().codepoint, &mark_x, &mark_y);
+    glyph_anchor.get_anchor (c, buffer->info[glyph_pos].codepoint, &base_x, &base_y);
 
     hb_glyph_position_t &o = buffer->cur_pos();
     o.x_offset = base_x - mark_x;
@@ -472,8 +476,7 @@
     unsigned int index = (this+coverage).get_coverage  (buffer->cur().codepoint);
     if (likely (index == NOT_COVERED)) return_trace (false);
 
-    valueFormat.apply_value (c->font, c->direction, this,
-                             values, buffer->cur_pos());
+    valueFormat.apply_value (c, this, values, buffer->cur_pos());
 
     buffer->idx++;
     return_trace (true);
@@ -523,7 +526,7 @@
 
     if (likely (index >= valueCount)) return_trace (false);
 
-    valueFormat.apply_value (c->font, c->direction, this,
+    valueFormat.apply_value (c, this,
                              &values[index * valueFormat.get_len ()],
                              buffer->cur_pos());
 
@@ -640,10 +643,8 @@
         min = mid + 1;
       else
       {
-        valueFormats[0].apply_value (c->font, c->direction, this,
-                                     &record->values[0], buffer->cur_pos());
-        valueFormats[1].apply_value (c->font, c->direction, this,
-                                     &record->values[len1], buffer->pos[pos]);
+        valueFormats[0].apply_value (c, this, &record->values[0], buffer->cur_pos());
+        valueFormats[1].apply_value (c, this, &record->values[len1], buffer->pos[pos]);
         if (len2)
           pos++;
         buffer->idx = pos;
@@ -689,7 +690,7 @@
     (this+coverage).add_coverage (c->input);
     unsigned int count = pairSet.len;
     for (unsigned int i = 0; i < count; i++)
-      (this+pairSet[i]).collect_glyphs (c, &valueFormat1);
+      (this+pairSet[i]).collect_glyphs (c, valueFormat);
   }
 
   inline const Coverage &get_coverage (void) const
@@ -708,7 +709,7 @@
     skippy_iter.reset (buffer->idx, 1);
     if (!skippy_iter.next ()) return_trace (false);
 
-    return_trace ((this+pairSet[index]).apply (c, &valueFormat1, skippy_iter.idx));
+    return_trace ((this+pairSet[index]).apply (c, valueFormat, skippy_iter.idx));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
@@ -717,11 +718,11 @@
 
     if (!c->check_struct (this)) return_trace (false);
 
-    unsigned int len1 = valueFormat1.get_len ();
-    unsigned int len2 = valueFormat2.get_len ();
+    unsigned int len1 = valueFormat[0].get_len ();
+    unsigned int len2 = valueFormat[1].get_len ();
     PairSet::sanitize_closure_t closure = {
       this,
-      &valueFormat1,
+      valueFormat,
       len1,
       1 + len1 + len2
     };
@@ -734,10 +735,10 @@
   OffsetTo<Coverage>
                 coverage;               /* Offset to Coverage table--from
                                          * beginning of subtable */
-  ValueFormat   valueFormat1;           /* Defines the types of data in
+  ValueFormat   valueFormat[2];         /* [0] Defines the types of data in
                                          * ValueRecord1--for the first glyph
                                          * in the pair--may be zero (0) */
-  ValueFormat   valueFormat2;           /* Defines the types of data in
+                                        /* [1] Defines the types of data in
                                          * ValueRecord2--for the second glyph
                                          * in the pair--may be zero (0) */
   OffsetArrayOf<PairSet>
@@ -790,10 +791,8 @@
     if (unlikely (klass1 >= class1Count || klass2 >= class2Count)) return_trace (false);
 
     const Value *v = &values[record_len * (klass1 * class2Count + klass2)];
-    valueFormat1.apply_value (c->font, c->direction, this,
-                              v, buffer->cur_pos());
-    valueFormat2.apply_value (c->font, c->direction, this,
-                              v + len1, buffer->pos[skippy_iter.idx]);
+    valueFormat1.apply_value (c, this, v, buffer->cur_pos());
+    valueFormat2.apply_value (c, this, v + len1, buffer->pos[skippy_iter.idx]);
 
     buffer->idx = skippy_iter.idx;
     if (len2)
@@ -931,8 +930,8 @@
     unsigned int j = skippy_iter.idx;
 
     hb_position_t entry_x, entry_y, exit_x, exit_y;
-    (this+this_record.exitAnchor).get_anchor (c->font, buffer->info[i].codepoint, &exit_x, &exit_y);
-    (this+next_record.entryAnchor).get_anchor (c->font, buffer->info[j].codepoint, &entry_x, &entry_y);
+    (this+this_record.exitAnchor).get_anchor (c, buffer->info[i].codepoint, &exit_x, &exit_y);
+    (this+next_record.entryAnchor).get_anchor (c, buffer->info[j].codepoint, &entry_x, &entry_y);
 
     hb_glyph_position_t *pos = buffer->pos;
 
@@ -1519,8 +1518,6 @@
     const OffsetTo<PosLookupList> &list = CastR<OffsetTo<PosLookupList> > (lookupList);
     return_trace (list.sanitize (c, this));
   }
-  public:
-  DEFINE_SIZE_STATIC (10);
 };
 
 
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsub-table.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsub-table.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -41,7 +41,10 @@
   {
     TRACE_CLOSURE (this);
     Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ()) {
+    for (iter.init (this+coverage); iter.more (); iter.next ())
+    {
+      /* TODO Switch to range-based API to work around malicious fonts.
+       * https://github.com/behdad/harfbuzz/issues/363 */
       hb_codepoint_t glyph_id = iter.get_glyph ();
       if (c->glyphs->has (glyph_id))
         c->glyphs->add ((glyph_id + deltaGlyphID) & 0xFFFFu);
@@ -52,7 +55,10 @@
   {
     TRACE_COLLECT_GLYPHS (this);
     Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ()) {
+    for (iter.init (this+coverage); iter.more (); iter.next ())
+    {
+      /* TODO Switch to range-based API to work around malicious fonts.
+       * https://github.com/behdad/harfbuzz/issues/363 */
       hb_codepoint_t glyph_id = iter.get_glyph ();
       c->input->add (glyph_id);
       c->output->add ((glyph_id + deltaGlyphID) & 0xFFFFu);
@@ -120,7 +126,11 @@
   {
     TRACE_CLOSURE (this);
     Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ()) {
+    unsigned int count = substitute.len;
+    for (iter.init (this+coverage); iter.more (); iter.next ())
+    {
+      if (unlikely (iter.get_coverage () >= count))
+        break; /* Work around malicious fonts. https://github.com/behdad/harfbuzz/issues/363 */
       if (c->glyphs->has (iter.get_glyph ()))
         c->glyphs->add (substitute[iter.get_coverage ()]);
     }
@@ -130,7 +140,11 @@
   {
     TRACE_COLLECT_GLYPHS (this);
     Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ()) {
+    unsigned int count = substitute.len;
+    for (iter.init (this+coverage); iter.more (); iter.next ())
+    {
+      if (unlikely (iter.get_coverage () >= count))
+        break; /* Work around malicious fonts. https://github.com/behdad/harfbuzz/issues/363 */
       c->input->add (iter.get_glyph ());
       c->output->add (substitute[iter.get_coverage ()]);
     }
@@ -321,7 +335,11 @@
   {
     TRACE_CLOSURE (this);
     Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ()) {
+    unsigned int count = sequence.len;
+    for (iter.init (this+coverage); iter.more (); iter.next ())
+    {
+      if (unlikely (iter.get_coverage () >= count))
+        break; /* Work around malicious fonts. https://github.com/behdad/harfbuzz/issues/363 */
       if (c->glyphs->has (iter.get_glyph ()))
         (this+sequence[iter.get_coverage ()]).closure (c);
     }
@@ -439,7 +457,11 @@
   {
     TRACE_CLOSURE (this);
     Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ()) {
+    unsigned int count = alternateSet.len;
+    for (iter.init (this+coverage); iter.more (); iter.next ())
+    {
+      if (unlikely (iter.get_coverage () >= count))
+        break; /* Work around malicious fonts. https://github.com/behdad/harfbuzz/issues/363 */
       if (c->glyphs->has (iter.get_glyph ())) {
         const AlternateSet &alt_set = this+alternateSet[iter.get_coverage ()];
         unsigned int count = alt_set.len;
@@ -453,7 +475,11 @@
   {
     TRACE_COLLECT_GLYPHS (this);
     Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ()) {
+    unsigned int count = alternateSet.len;
+    for (iter.init (this+coverage); iter.more (); iter.next ())
+    {
+      if (unlikely (iter.get_coverage () >= count))
+        break; /* Work around malicious fonts. https://github.com/behdad/harfbuzz/issues/363 */
       c->input->add (iter.get_glyph ());
       const AlternateSet &alt_set = this+alternateSet[iter.get_coverage ()];
       unsigned int count = alt_set.len;
@@ -762,7 +788,11 @@
   {
     TRACE_CLOSURE (this);
     Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ()) {
+    unsigned int count = ligatureSet.len;
+    for (iter.init (this+coverage); iter.more (); iter.next ())
+    {
+      if (unlikely (iter.get_coverage () >= count))
+        break; /* Work around malicious fonts. https://github.com/behdad/harfbuzz/issues/363 */
       if (c->glyphs->has (iter.get_glyph ()))
         (this+ligatureSet[iter.get_coverage ()]).closure (c);
     }
@@ -772,7 +802,11 @@
   {
     TRACE_COLLECT_GLYPHS (this);
     Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ()) {
+    unsigned int count = ligatureSet.len;
+    for (iter.init (this+coverage); iter.more (); iter.next ())
+    {
+      if (unlikely (iter.get_coverage () >= count))
+        break; /* Work around malicious fonts. https://github.com/behdad/harfbuzz/issues/363 */
       c->input->add (iter.get_glyph ());
       (this+ligatureSet[iter.get_coverage ()]).collect_glyphs (c);
     }
@@ -923,7 +957,11 @@
 
     const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
     Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ()) {
+    count = substitute.len;
+    for (iter.init (this+coverage); iter.more (); iter.next ())
+    {
+      if (unlikely (iter.get_coverage () >= count))
+        break; /* Work around malicious fonts. https://github.com/behdad/harfbuzz/issues/363 */
       if (c->glyphs->has (iter.get_glyph ()))
         c->glyphs->add (substitute[iter.get_coverage ()]);
     }
@@ -1273,8 +1311,6 @@
     const OffsetTo<SubstLookupList> &list = CastR<OffsetTo<SubstLookupList> > (lookupList);
     return_trace (list.sanitize (c, this));
   }
-  public:
-  DEFINE_SIZE_STATIC (10);
 };
 
 
@@ -1285,28 +1321,10 @@
 
   const GDEF &gdef = *hb_ot_layout_from_face (font->face)->gdef;
   unsigned int count = buffer->len;
-  hb_glyph_info_t *info = buffer->info;
   for (unsigned int i = 0; i < count; i++)
   {
-    unsigned int props = gdef.get_glyph_props (info[i].codepoint);
-    if (!props)
-    {
-      /* Never mark default-ignorables as marks.
-       * They won't get in the way of lookups anyway,
-       * but having them as mark will cause them to be skipped
-       * over if the lookup-flag says so, but at least for the
-       * Mongolian variation selectors, looks like Uniscribe
-       * marks them as non-mark.  Some Mongolian fonts without
-       * GDEF rely on this.  Another notable character that
-       * this applies to is COMBINING GRAPHEME JOINER. */
-      props = (_hb_glyph_info_get_general_category (&info[i]) !=
-               HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK ||
-               _hb_glyph_info_is_default_ignorable (&info[i])) ?
-              HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH :
-              HB_OT_LAYOUT_GLYPH_PROPS_MARK;
-    }
-    _hb_glyph_info_set_glyph_props (&info[i], props);
-    _hb_glyph_info_clear_lig_props (&info[i]);
+    _hb_glyph_info_set_glyph_props (&buffer->info[i], gdef.get_glyph_props (buffer->info[i].codepoint));
+    _hb_glyph_info_clear_lig_props (&buffer->info[i]);
     buffer->info[i].syllable() = 0;
   }
 }
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsubgpos-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsubgpos-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -469,6 +469,7 @@
   unsigned int lookup_props;
   const GDEF &gdef;
   bool has_glyph_classes;
+  const VariationStore &var_store;
   skipping_iterator_t iter_input, iter_context;
   unsigned int lookup_index;
   unsigned int debug_depth;
@@ -487,6 +488,7 @@
                         lookup_props (0),
                         gdef (*hb_ot_layout_from_face (face)->gdef),
                         has_glyph_classes (gdef.has_glyph_classes ()),
+                        var_store (gdef.get_var_store ()),
                         iter_input (),
                         iter_context (),
                         lookup_index ((unsigned int) -1),
@@ -999,8 +1001,12 @@
     end = int (end) + delta;
     if (end <= match_positions[idx])
     {
+      /* End might end up being smaller than match_positions[idx] if the recursed
+       * lookup ended up removing many items, more than we have had matched.
+       * Just never rewind end back and get out of here.
+       * https://bugs.chromium.org/p/chromium/issues/detail?id=659496 */
+      end = match_positions[idx];
       /* There can't be any further changes. */
-      assert (end == match_positions[idx]);
       break;
     }
 
@@ -2269,6 +2275,24 @@
   inline const Lookup& get_lookup (unsigned int i) const
   { return (this+lookupList)[i]; }
 
+  inline bool find_variations_index (const int *coords, unsigned int num_coords,
+                                     unsigned int *index) const
+  { return (version.to_int () >= 0x00010001u ? this+featureVars : Null(FeatureVariations))
+           .find_index (coords, num_coords, index); }
+  inline const Feature& get_feature_variation (unsigned int feature_index,
+                                               unsigned int variations_index) const
+  {
+    if (FeatureVariations::NOT_FOUND_INDEX != variations_index &&
+        version.to_int () >= 0x00010001u)
+    {
+      const Feature *feature = (this+featureVars).find_substitute (variations_index,
+                                                                   feature_index);
+      if (feature)
+        return *feature;
+    }
+    return get_feature (feature_index);
+  }
+
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
@@ -2276,7 +2300,8 @@
                   likely (version.major == 1) &&
                   scriptList.sanitize (c, this) &&
                   featureList.sanitize (c, this) &&
-                  lookupList.sanitize (c, this));
+                  lookupList.sanitize (c, this) &&
+                  (version.to_int () < 0x00010001u || featureVars.sanitize (c, this)));
   }
 
   protected:
@@ -2288,8 +2313,13 @@
                 featureList;    /* FeatureList table */
   OffsetTo<LookupList>
                 lookupList;     /* LookupList table */
+  OffsetTo<FeatureVariations, ULONG>
+                featureVars;    /* Offset to Feature Variations
+                                   table--from beginning of table
+                                 * (may be NULL).  Introduced
+                                 * in version 0x00010001. */
   public:
-  DEFINE_SIZE_STATIC (10);
+  DEFINE_SIZE_MIN (10);
 };
 
 
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -124,6 +124,7 @@
   struct GDEF;
   struct GSUB;
   struct GPOS;
+  struct MATH;
 }
 
 struct hb_ot_layout_lookup_accelerator_t
@@ -152,10 +153,12 @@
   hb_blob_t *gdef_blob;
   hb_blob_t *gsub_blob;
   hb_blob_t *gpos_blob;
+  hb_blob_t *math_blob;
 
   const struct OT::GDEF *gdef;
   const struct OT::GSUB *gsub;
   const struct OT::GPOS *gpos;
+  const struct OT::MATH *math;
 
   unsigned int gsub_lookup_count;
   unsigned int gpos_lookup_count;
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -60,6 +60,10 @@
   layout->gpos_blob = OT::Sanitizer<OT::GPOS>::sanitize (face->reference_table (HB_OT_TAG_GPOS));
   layout->gpos = OT::Sanitizer<OT::GPOS>::lock_instance (layout->gpos_blob);
 
+  /* The MATH table is rarely used, so only try and load it in _get_math. */
+  layout->math_blob = NULL;
+  layout->math = NULL;
+
   {
     /*
      * The ugly business of blacklisting individual fonts' tables happen here!
@@ -120,6 +124,14 @@
       /* 2c0c90c6f6087ffbfea76589c93113a9cbb0e75f  cantarell-fonts-0.0.21/otf/Cantarell-Bold.otf */
       /* 55461f5b853c6da88069ffcdf7f4dd3f8d7e3e6b  cantarell-fonts-0.0.21/otf/Cantarell-Bold-Oblique.otf */
       || (188 == gdef_len && 3426 == gpos_len && 264 == gsub_len)
+      /* 6c93b63b64e8b2c93f5e824e78caca555dc887c7 padauk-2.80/Padauk-book.ttf */
+      || (1046 == gdef_len && 17112 == gpos_len && 71788 == gsub_len)
+      /* d89b1664058359b8ec82e35d3531931125991fb9 padauk-2.80/Padauk-bookbold.ttf */
+      || (1058 == gdef_len && 17514 == gpos_len && 71794 == gsub_len)
+      /* 824cfd193aaf6234b2b4dc0cf3c6ef576c0d00ef padauk-3.0/Padauk-book.ttf */
+      || (1330 == gdef_len && 57938 == gpos_len && 109904 == gsub_len)
+      /* 91fcc10cf15e012d27571e075b3b4dfe31754a8a padauk-3.0/Padauk-bookbold.ttf */
+      || (1330 == gdef_len && 58972 == gpos_len && 109904 == gsub_len)
     )
     {
       /* Many versions of Tahoma have bad GDEF tables that incorrectly classify some spacing marks
@@ -169,6 +181,7 @@
   hb_blob_destroy (layout->gdef_blob);
   hb_blob_destroy (layout->gsub_blob);
   hb_blob_destroy (layout->gpos_blob);
+  hb_blob_destroy (layout->math_blob);
 
   free (layout);
 }
@@ -192,7 +205,6 @@
   return *hb_ot_layout_from_face (face)->gpos;
 }
 
-
 /*
  * GDEF
  */
@@ -544,10 +556,13 @@
                                   unsigned int *lookup_count /* IN/OUT */,
                                   unsigned int *lookup_indexes /* OUT */)
 {
-  const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
-  const OT::Feature &f = g.get_feature (feature_index);
-
-  return f.get_lookup_indexes (start_offset, lookup_count, lookup_indexes);
+  return hb_ot_layout_feature_with_variations_get_lookups (face,
+                                                           table_tag,
+                                                           feature_index,
+                                                           HB_OT_LAYOUT_NO_VARIATIONS_INDEX,
+                                                           start_offset,
+                                                           lookup_count,
+                                                           lookup_indexes);
 }
 
 /**
@@ -798,6 +813,38 @@
 }
 
 
+/* Variations support */
+
+hb_bool_t
+hb_ot_layout_table_find_feature_variations (hb_face_t    *face,
+                                            hb_tag_t      table_tag,
+                                            const int    *coords,
+                                            unsigned int  num_coords,
+                                            unsigned int *variations_index /* out */)
+{
+  const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
+
+  return g.find_variations_index (coords, num_coords, variations_index);
+}
+
+unsigned int
+hb_ot_layout_feature_with_variations_get_lookups (hb_face_t    *face,
+                                                  hb_tag_t      table_tag,
+                                                  unsigned int  feature_index,
+                                                  unsigned int  variations_index,
+                                                  unsigned int  start_offset,
+                                                  unsigned int *lookup_count /* IN/OUT */,
+                                                  unsigned int *lookup_indexes /* OUT */)
+{
+  ASSERT_STATIC (OT::FeatureVariations::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_VARIATIONS_INDEX);
+  const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
+
+  const OT::Feature &f = g.get_feature_variation (feature_index, variations_index);
+
+  return f.get_lookup_indexes (start_offset, lookup_count, lookup_indexes);
+}
+
+
 /*
  * OT::GSUB
  */
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.h	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.h	Sat Jan 21 03:53:21 2017 +0000
@@ -95,6 +95,7 @@
 #define HB_OT_LAYOUT_NO_SCRIPT_INDEX            0xFFFFu
 #define HB_OT_LAYOUT_NO_FEATURE_INDEX           0xFFFFu
 #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX     0xFFFFu
+#define HB_OT_LAYOUT_NO_VARIATIONS_INDEX        0xFFFFFFFFu
 
 HB_EXTERN unsigned int
 hb_ot_layout_table_get_script_tags (hb_face_t    *face,
@@ -236,6 +237,24 @@
                                          void         *user_data);
 #endif
 
+/* Variations support */
+
+HB_EXTERN hb_bool_t
+hb_ot_layout_table_find_feature_variations (hb_face_t    *face,
+                                            hb_tag_t      table_tag,
+                                            const int    *coords,
+                                            unsigned int  num_coords,
+                                            unsigned int *variations_index /* out */);
+
+HB_EXTERN unsigned int
+hb_ot_layout_feature_with_variations_get_lookups (hb_face_t    *face,
+                                                  hb_tag_t      table_tag,
+                                                  unsigned int  feature_index,
+                                                  unsigned int  variations_index,
+                                                  unsigned int  start_offset,
+                                                  unsigned int *lookup_count /* IN/OUT */,
+                                                  unsigned int *lookup_indexes /* OUT */);
+
 
 /*
  * GSUB
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -139,12 +139,6 @@
 
   private:
 
-  HB_INTERNAL void add_lookups (hb_face_t    *face,
-                                unsigned int  table_index,
-                                unsigned int  feature_index,
-                                hb_mask_t     mask,
-                                bool          auto_zwj);
-
   hb_mask_t global_mask;
 
   hb_prealloced_array_t<feature_map_t, 8> features;
@@ -182,7 +176,9 @@
   inline void add_gpos_pause (hb_ot_map_t::pause_func_t pause_func)
   { add_pause (1, pause_func); }
 
-  HB_INTERNAL void compile (struct hb_ot_map_t &m);
+  HB_INTERNAL void compile (hb_ot_map_t  &m,
+                            const int    *coords,
+                            unsigned int  num_coords);
 
   inline void finish (void) {
     feature_infos.finish ();
@@ -194,6 +190,14 @@
 
   private:
 
+  HB_INTERNAL void add_lookups (hb_ot_map_t  &m,
+                                hb_face_t    *face,
+                                unsigned int  table_index,
+                                unsigned int  feature_index,
+                                unsigned int  variations_index,
+                                hb_mask_t     mask,
+                                bool          auto_zwj);
+
   struct feature_info_t {
     hb_tag_t tag;
     unsigned int seq; /* sequence#, used for stable sorting only */
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -31,43 +31,12 @@
 #include "hb-ot-layout-private.hh"
 
 
-void
-hb_ot_map_t::add_lookups (hb_face_t    *face,
-                          unsigned int  table_index,
-                          unsigned int  feature_index,
-                          hb_mask_t     mask,
-                          bool          auto_zwj)
+void hb_ot_map_t::collect_lookups (unsigned int table_index, hb_set_t *lookups_out) const
 {
-  unsigned int lookup_indices[32];
-  unsigned int offset, len;
-  unsigned int table_lookup_count;
-
-  table_lookup_count = hb_ot_layout_table_get_lookup_count (face, table_tags[table_index]);
+  for (unsigned int i = 0; i < lookups[table_index].len; i++)
+    hb_set_add (lookups_out, lookups[table_index][i].index);
+}
 
-  offset = 0;
-  do {
-    len = ARRAY_LENGTH (lookup_indices);
-    hb_ot_layout_feature_get_lookups (face,
-                                      table_tags[table_index],
-                                      feature_index,
-                                      offset, &len,
-                                      lookup_indices);
-
-    for (unsigned int i = 0; i < len; i++)
-    {
-      if (lookup_indices[i] >= table_lookup_count)
-        continue;
-      hb_ot_map_t::lookup_map_t *lookup = lookups[table_index].push ();
-      if (unlikely (!lookup))
-        return;
-      lookup->mask = mask;
-      lookup->index = lookup_indices[i];
-      lookup->auto_zwj = auto_zwj;
-    }
-
-    offset += len;
-  } while (len == ARRAY_LENGTH (lookup_indices));
-}
 
 hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_,
                                           const hb_segment_properties_t *props_)
@@ -109,13 +78,48 @@
   info->stage[1] = current_stage[1];
 }
 
-
-void hb_ot_map_t::collect_lookups (unsigned int table_index, hb_set_t *lookups_out) const
+void
+hb_ot_map_builder_t::add_lookups (hb_ot_map_t  &m,
+                                  hb_face_t    *face,
+                                  unsigned int  table_index,
+                                  unsigned int  feature_index,
+                                  unsigned int  variations_index,
+                                  hb_mask_t     mask,
+                                  bool          auto_zwj)
 {
-  for (unsigned int i = 0; i < lookups[table_index].len; i++)
-    hb_set_add (lookups_out, lookups[table_index][i].index);
+  unsigned int lookup_indices[32];
+  unsigned int offset, len;
+  unsigned int table_lookup_count;
+
+  table_lookup_count = hb_ot_layout_table_get_lookup_count (face, table_tags[table_index]);
+
+  offset = 0;
+  do {
+    len = ARRAY_LENGTH (lookup_indices);
+    hb_ot_layout_feature_with_variations_get_lookups (face,
+                                                      table_tags[table_index],
+                                                      feature_index,
+                                                      variations_index,
+                                                      offset, &len,
+                                                      lookup_indices);
+
+    for (unsigned int i = 0; i < len; i++)
+    {
+      if (lookup_indices[i] >= table_lookup_count)
+        continue;
+      hb_ot_map_t::lookup_map_t *lookup = m.lookups[table_index].push ();
+      if (unlikely (!lookup))
+        return;
+      lookup->mask = mask;
+      lookup->index = lookup_indices[i];
+      lookup->auto_zwj = auto_zwj;
+    }
+
+    offset += len;
+  } while (len == ARRAY_LENGTH (lookup_indices));
 }
 
+
 void hb_ot_map_builder_t::add_pause (unsigned int table_index, hb_ot_map_t::pause_func_t pause_func)
 {
   stage_info_t *s = stages[table_index].push ();
@@ -128,7 +132,9 @@
 }
 
 void
-hb_ot_map_builder_t::compile (hb_ot_map_t &m)
+hb_ot_map_builder_t::compile (hb_ot_map_t  &m,
+                              const int    *coords,
+                              unsigned int  num_coords)
 {
   m.global_mask = 1;
 
@@ -193,7 +199,8 @@
       /* Uses the global bit */
       bits_needed = 0;
     else
-      bits_needed = _hb_bit_storage (info->max_value);
+      /* Limit to 8 bits per feature. */
+      bits_needed = MIN(8u, _hb_bit_storage (info->max_value));
 
     if (!info->max_value || next_bit + bits_needed > 8 * sizeof (hb_mask_t))
       continue; /* Feature disabled, or not enough bits. */
@@ -243,11 +250,11 @@
       map->mask = 1;
     } else {
       map->shift = next_bit;
-      map->mask = (1 << (next_bit + bits_needed)) - (1 << next_bit);
+      map->mask = (1u << (next_bit + bits_needed)) - (1u << next_bit);
       next_bit += bits_needed;
       m.global_mask |= (info->default_value << map->shift) & map->mask;
     }
-    map->_1_mask = (1 << map->shift) & map->mask;
+    map->_1_mask = (1u << map->shift) & map->mask;
     map->needs_fallback = !found;
 
   }
@@ -261,23 +268,32 @@
   {
     /* Collect lookup indices for features */
 
+    unsigned int variations_index;
+    hb_ot_layout_table_find_feature_variations (face,
+                                                table_tags[table_index],
+                                                coords,
+                                                num_coords,
+                                                &variations_index);
+
     unsigned int stage_index = 0;
     unsigned int last_num_lookups = 0;
     for (unsigned stage = 0; stage < current_stage[table_index]; stage++)
     {
       if (required_feature_index[table_index] != HB_OT_LAYOUT_NO_FEATURE_INDEX &&
           required_feature_stage[table_index] == stage)
-        m.add_lookups (face, table_index,
-                       required_feature_index[table_index],
-                       1 /* mask */,
-                       true /* auto_zwj */);
+        add_lookups (m, face, table_index,
+                     required_feature_index[table_index],
+                     variations_index,
+                     1 /* mask */,
+                     true /* auto_zwj */);
 
       for (unsigned i = 0; i < m.features.len; i++)
         if (m.features[i].stage[table_index] == stage)
-          m.add_lookups (face, table_index,
-                         m.features[i].index[table_index],
-                         m.features[i].mask,
-                         m.features[i].auto_zwj);
+          add_lookups (m, face, table_index,
+                       m.features[i].index[table_index],
+                       variations_index,
+                       m.features[i].mask,
+                       m.features[i].auto_zwj);
 
       /* Sort lookups and merge duplicates */
       if (last_num_lookups < m.lookups[table_index].len)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-math.h	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,209 @@
+/*
+ * Copyright © 2016  Igalia S.L.
+ *
+ *  This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Igalia Author(s): Frédéric Wang
+ */
+
+#ifndef HB_OT_H_IN
+#error "Include <hb-ot.h> instead."
+#endif
+
+#ifndef HB_OT_MATH_H
+#define HB_OT_MATH_H
+
+#include "hb.h"
+
+HB_BEGIN_DECLS
+
+
+/*
+ * MATH
+ */
+
+#define HB_OT_TAG_MATH HB_TAG('M','A','T','H')
+
+/* Use with hb_buffer_set_script() for math shaping. */
+#define HB_OT_MATH_SCRIPT HB_TAG('m','a','t','h')
+
+/* Types */
+
+/**
+ * hb_ot_math_constant_t:
+ *
+ * Since: 1.3.3
+ */
+typedef enum {
+  HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN = 0,
+  HB_OT_MATH_CONSTANT_SCRIPT_SCRIPT_PERCENT_SCALE_DOWN = 1,
+  HB_OT_MATH_CONSTANT_DELIMITED_SUB_FORMULA_MIN_HEIGHT = 2,
+  HB_OT_MATH_CONSTANT_DISPLAY_OPERATOR_MIN_HEIGHT = 3,
+  HB_OT_MATH_CONSTANT_MATH_LEADING = 4,
+  HB_OT_MATH_CONSTANT_AXIS_HEIGHT = 5,
+  HB_OT_MATH_CONSTANT_ACCENT_BASE_HEIGHT = 6,
+  HB_OT_MATH_CONSTANT_FLATTENED_ACCENT_BASE_HEIGHT = 7,
+  HB_OT_MATH_CONSTANT_SUBSCRIPT_SHIFT_DOWN = 8,
+  HB_OT_MATH_CONSTANT_SUBSCRIPT_TOP_MAX = 9,
+  HB_OT_MATH_CONSTANT_SUBSCRIPT_BASELINE_DROP_MIN = 10,
+  HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP = 11,
+  HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP_CRAMPED = 12,
+  HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MIN = 13,
+  HB_OT_MATH_CONSTANT_SUPERSCRIPT_BASELINE_DROP_MAX = 14,
+  HB_OT_MATH_CONSTANT_SUB_SUPERSCRIPT_GAP_MIN = 15,
+  HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MAX_WITH_SUBSCRIPT = 16,
+  HB_OT_MATH_CONSTANT_SPACE_AFTER_SCRIPT = 17,
+  HB_OT_MATH_CONSTANT_UPPER_LIMIT_GAP_MIN = 18,
+  HB_OT_MATH_CONSTANT_UPPER_LIMIT_BASELINE_RISE_MIN = 19,
+  HB_OT_MATH_CONSTANT_LOWER_LIMIT_GAP_MIN = 20,
+  HB_OT_MATH_CONSTANT_LOWER_LIMIT_BASELINE_DROP_MIN = 21,
+  HB_OT_MATH_CONSTANT_STACK_TOP_SHIFT_UP = 22,
+  HB_OT_MATH_CONSTANT_STACK_TOP_DISPLAY_STYLE_SHIFT_UP = 23,
+  HB_OT_MATH_CONSTANT_STACK_BOTTOM_SHIFT_DOWN = 24,
+  HB_OT_MATH_CONSTANT_STACK_BOTTOM_DISPLAY_STYLE_SHIFT_DOWN = 25,
+  HB_OT_MATH_CONSTANT_STACK_GAP_MIN = 26,
+  HB_OT_MATH_CONSTANT_STACK_DISPLAY_STYLE_GAP_MIN = 27,
+  HB_OT_MATH_CONSTANT_STRETCH_STACK_TOP_SHIFT_UP = 28,
+  HB_OT_MATH_CONSTANT_STRETCH_STACK_BOTTOM_SHIFT_DOWN = 29,
+  HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_ABOVE_MIN = 30,
+  HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_BELOW_MIN = 31,
+  HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_SHIFT_UP = 32,
+  HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_DISPLAY_STYLE_SHIFT_UP = 33,
+  HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_SHIFT_DOWN = 34,
+  HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_DISPLAY_STYLE_SHIFT_DOWN = 35,
+  HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_GAP_MIN = 36,
+  HB_OT_MATH_CONSTANT_FRACTION_NUM_DISPLAY_STYLE_GAP_MIN = 37,
+  HB_OT_MATH_CONSTANT_FRACTION_RULE_THICKNESS = 38,
+  HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_GAP_MIN = 39,
+  HB_OT_MATH_CONSTANT_FRACTION_DENOM_DISPLAY_STYLE_GAP_MIN = 40,
+  HB_OT_MATH_CONSTANT_SKEWED_FRACTION_HORIZONTAL_GAP = 41,
+  HB_OT_MATH_CONSTANT_SKEWED_FRACTION_VERTICAL_GAP = 42,
+  HB_OT_MATH_CONSTANT_OVERBAR_VERTICAL_GAP = 43,
+  HB_OT_MATH_CONSTANT_OVERBAR_RULE_THICKNESS = 44,
+  HB_OT_MATH_CONSTANT_OVERBAR_EXTRA_ASCENDER = 45,
+  HB_OT_MATH_CONSTANT_UNDERBAR_VERTICAL_GAP = 46,
+  HB_OT_MATH_CONSTANT_UNDERBAR_RULE_THICKNESS = 47,
+  HB_OT_MATH_CONSTANT_UNDERBAR_EXTRA_DESCENDER = 48,
+  HB_OT_MATH_CONSTANT_RADICAL_VERTICAL_GAP = 49,
+  HB_OT_MATH_CONSTANT_RADICAL_DISPLAY_STYLE_VERTICAL_GAP = 50,
+  HB_OT_MATH_CONSTANT_RADICAL_RULE_THICKNESS = 51,
+  HB_OT_MATH_CONSTANT_RADICAL_EXTRA_ASCENDER = 52,
+  HB_OT_MATH_CONSTANT_RADICAL_KERN_BEFORE_DEGREE = 53,
+  HB_OT_MATH_CONSTANT_RADICAL_KERN_AFTER_DEGREE = 54,
+  HB_OT_MATH_CONSTANT_RADICAL_DEGREE_BOTTOM_RAISE_PERCENT = 55
+} hb_ot_math_constant_t;
+
+/**
+ * hb_ot_math_kern_t:
+ *
+ * Since: 1.3.3
+ */
+typedef enum {
+  HB_OT_MATH_KERN_TOP_RIGHT = 0,
+  HB_OT_MATH_KERN_TOP_LEFT = 1,
+  HB_OT_MATH_KERN_BOTTOM_RIGHT = 2,
+  HB_OT_MATH_KERN_BOTTOM_LEFT = 3
+} hb_ot_math_kern_t;
+
+/**
+ * hb_ot_math_glyph_variant_t:
+ *
+ * Since: 1.3.3
+ */
+typedef struct hb_ot_math_glyph_variant_t {
+  hb_codepoint_t glyph;
+  hb_position_t advance;
+} hb_ot_math_glyph_variant_t;
+
+/**
+ * hb_ot_math_glyph_part_flags_t:
+ *
+ * Since: 1.3.3
+ */
+typedef enum { /*< flags >*/
+  HB_MATH_GLYPH_PART_FLAG_EXTENDER      = 0x00000001u  /* Extender glyph */
+} hb_ot_math_glyph_part_flags_t;
+
+/**
+ * hb_ot_math_glyph_part_t:
+ *
+ * Since: 1.3.3
+ */
+typedef struct hb_ot_math_glyph_part_t {
+  hb_codepoint_t glyph;
+  hb_position_t start_connector_length;
+  hb_position_t end_connector_length;
+  hb_position_t full_advance;
+  hb_ot_math_glyph_part_flags_t flags;
+} hb_ot_math_glyph_part_t;
+
+/* Methods */
+
+HB_EXTERN hb_bool_t
+hb_ot_math_has_data (hb_face_t *face);
+
+HB_EXTERN hb_position_t
+hb_ot_math_get_constant (hb_font_t *font,
+                         hb_ot_math_constant_t constant);
+
+HB_EXTERN hb_position_t
+hb_ot_math_get_glyph_italics_correction (hb_font_t *font,
+                                         hb_codepoint_t glyph);
+
+HB_EXTERN hb_position_t
+hb_ot_math_get_glyph_top_accent_attachment (hb_font_t *font,
+                                            hb_codepoint_t glyph);
+
+HB_EXTERN hb_bool_t
+hb_ot_math_is_glyph_extended_shape (hb_face_t *face,
+                                    hb_codepoint_t glyph);
+
+HB_EXTERN hb_position_t
+hb_ot_math_get_glyph_kerning (hb_font_t *font,
+                              hb_codepoint_t glyph,
+                              hb_ot_math_kern_t kern,
+                              hb_position_t correction_height);
+
+HB_EXTERN unsigned int
+hb_ot_math_get_glyph_variants (hb_font_t *font,
+                               hb_codepoint_t glyph,
+                               hb_direction_t direction,
+                               unsigned int start_offset,
+                               unsigned int *variants_count, /* IN/OUT */
+                               hb_ot_math_glyph_variant_t *variants /* OUT */);
+
+HB_EXTERN hb_position_t
+hb_ot_math_get_min_connector_overlap (hb_font_t *font,
+                                      hb_direction_t direction);
+
+HB_EXTERN unsigned int
+hb_ot_math_get_glyph_assembly (hb_font_t *font,
+                               hb_codepoint_t glyph,
+                               hb_direction_t direction,
+                               unsigned int start_offset,
+                               unsigned int *parts_count, /* IN/OUT */
+                               hb_ot_math_glyph_part_t *parts, /* OUT */
+                               hb_position_t *italics_correction /* OUT */);
+
+
+HB_END_DECLS
+
+#endif /* HB_OT_MATH_H */
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -618,6 +618,7 @@
   NULL, /* decompose */
   NULL, /* compose */
   setup_masks_arabic,
+  NULL, /* disable_otl */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   true, /* fallback_position */
 };
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-default.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-default.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -40,6 +40,7 @@
   NULL, /* decompose */
   NULL, /* compose */
   NULL, /* setup_masks */
+  NULL, /* disable_otl */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   true, /* fallback_position */
 };
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hangul.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hangul.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -419,6 +419,7 @@
   NULL, /* decompose */
   NULL, /* compose */
   setup_masks_hangul,
+  NULL, /* disable_otl */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
   false, /* fallback_position */
 };
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hebrew.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hebrew.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -154,6 +154,18 @@
   return found;
 }
 
+static bool
+disable_otl_hebrew (const hb_ot_shape_plan_t *plan)
+{
+  /* For Hebrew shaper, use fallback if GPOS does not have 'hebr'
+   * script.  This matches Uniscribe better, and makes fonts like
+   * Arial that have GSUB/GPOS/GDEF but no data for Hebrew work.
+   * See:
+   * https://github.com/behdad/harfbuzz/issues/347#issuecomment-267838368
+   */
+  return plan->map.chosen_script[1] != HB_TAG ('h','e','b','r');
+}
+
 
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hebrew =
 {
@@ -168,6 +180,7 @@
   NULL, /* decompose */
   compose_hebrew,
   NULL, /* setup_masks */
+  disable_otl_hebrew,
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   true, /* fallback_position */
 };
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-machine.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-machine.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -34,1316 +34,1316 @@
 
 #line 36 "hb-ot-shape-complex-indic-machine.hh"
 static const unsigned char _indic_syllable_machine_trans_keys[] = {
-        8u, 8u, 1u, 16u, 8u, 13u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u,
-        7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 4u, 8u,
-        6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u,
-        4u, 8u, 6u, 6u, 16u, 16u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u,
-        4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 8u, 8u, 1u, 16u, 8u, 13u,
-        5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u,
-        7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u,
-        6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u,
-        4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u,
-        4u, 14u, 4u, 14u, 8u, 8u, 1u, 16u, 8u, 13u, 5u, 8u, 5u, 7u, 7u, 7u,
-        5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u,
-        7u, 7u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u,
-        6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 14u, 4u, 14u, 4u, 14u,
-        4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 8u, 8u, 1u, 16u,
-        8u, 13u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u,
-        5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 4u, 8u, 6u, 6u, 16u, 16u,
-        4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u,
-        16u, 16u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u,
-        4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 5u, 8u, 4u, 14u, 4u, 14u, 5u, 8u,
-        5u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u,
-        5u, 7u, 7u, 7u, 8u, 8u, 1u, 16u, 8u, 13u, 4u, 8u, 6u, 6u, 16u, 16u,
-        4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u,
-        16u, 16u, 8u, 8u, 1u, 18u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u,
-        3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u,
-        3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 5u, 14u, 5u, 14u,
-        5u, 10u, 9u, 10u, 9u, 9u, 9u, 10u, 9u, 10u, 9u, 9u, 5u, 10u, 3u, 13u,
-        3u, 10u, 5u, 10u, 3u, 10u, 3u, 13u, 3u, 14u, 3u, 14u, 4u, 14u, 5u, 14u,
-        3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u,
-        5u, 14u, 3u, 14u, 1u, 16u, 4u, 14u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u,
-        1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u,
-        1u, 16u, 1u, 16u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u,
-        1u, 16u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u,
-        3u, 17u, 3u, 17u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u,
-        4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u,
-        4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 5u, 14u, 5u, 14u, 5u, 10u,
-        9u, 10u, 9u, 9u, 9u, 10u, 9u, 10u, 9u, 9u, 5u, 10u, 3u, 13u, 3u, 10u,
-        5u, 10u, 3u, 10u, 3u, 13u, 3u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u,
-        4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u,
-        3u, 14u, 1u, 16u, 4u, 14u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u,
-        1u, 16u, 1u, 16u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u,
-        1u, 16u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u,
-        3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 4u, 14u, 1u, 16u,
-        3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u,
-        3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u,
-        3u, 17u, 3u, 17u, 4u, 17u, 5u, 14u, 5u, 14u, 5u, 10u, 9u, 10u, 9u, 9u,
-        9u, 10u, 9u, 10u, 9u, 9u, 5u, 10u, 3u, 13u, 3u, 10u, 5u, 10u, 3u, 10u,
-        3u, 13u, 3u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u,
-        3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 1u, 16u,
-        4u, 14u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u,
-        3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u,
-        3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u, 3u, 17u,
-        1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 4u, 14u, 3u, 17u, 4u, 14u,
-        3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u,
-        3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u,
-        3u, 17u, 3u, 17u, 4u, 17u, 5u, 14u, 5u, 14u, 5u, 10u, 9u, 10u, 9u, 9u,
-        9u, 10u, 9u, 10u, 9u, 9u, 5u, 10u, 3u, 13u, 3u, 10u, 5u, 10u, 3u, 10u,
-        3u, 13u, 3u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u,
-        3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 1u, 16u,
-        4u, 14u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u,
-        3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u,
-        3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u, 3u, 17u,
-        1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u, 1u, 17u, 3u, 17u,
-        1u, 17u, 4u, 14u, 5u, 10u, 9u, 10u, 9u, 9u, 9u, 10u, 9u, 10u, 9u, 9u,
-        5u, 10u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 3u, 17u, 3u, 17u, 1u, 16u,
-        3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u,
-        5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 13u, 3u, 10u, 5u, 10u, 3u, 10u,
-        3u, 13u, 1u, 16u, 3u, 10u, 5u, 10u, 5u, 10u, 9u, 10u, 9u, 9u, 9u, 10u,
+        8u, 8u, 1u, 16u, 8u, 13u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 
+        7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 4u, 8u, 
+        6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 
+        4u, 8u, 6u, 6u, 16u, 16u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 
+        4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 8u, 8u, 1u, 16u, 8u, 13u, 
+        5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 
+        7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 
+        6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 
+        4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 
+        4u, 14u, 4u, 14u, 8u, 8u, 1u, 16u, 8u, 13u, 5u, 8u, 5u, 7u, 7u, 7u, 
+        5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 
+        7u, 7u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 
+        6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 14u, 4u, 14u, 4u, 14u, 
+        4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 8u, 8u, 1u, 16u, 
+        8u, 13u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 
+        5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 4u, 8u, 6u, 6u, 16u, 16u, 
+        4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 
+        16u, 16u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 
+        4u, 14u, 4u, 14u, 4u, 14u, 4u, 14u, 5u, 8u, 4u, 14u, 4u, 14u, 5u, 8u, 
+        5u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 5u, 7u, 7u, 7u, 5u, 8u, 
+        5u, 7u, 7u, 7u, 8u, 8u, 1u, 16u, 8u, 13u, 4u, 8u, 6u, 6u, 16u, 16u, 
+        4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 6u, 6u, 
+        16u, 16u, 8u, 8u, 1u, 18u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 
+        3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 
+        3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 5u, 14u, 5u, 14u, 
+        5u, 10u, 9u, 10u, 9u, 9u, 9u, 10u, 9u, 10u, 9u, 9u, 5u, 10u, 3u, 13u, 
+        3u, 10u, 5u, 10u, 3u, 10u, 3u, 13u, 3u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 
+        3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 
+        5u, 14u, 3u, 14u, 1u, 16u, 4u, 14u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 
+        1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 
+        1u, 16u, 1u, 16u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 
+        1u, 16u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 
+        3u, 17u, 3u, 17u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 
+        4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 
+        4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 5u, 14u, 5u, 14u, 5u, 10u, 
+        9u, 10u, 9u, 9u, 9u, 10u, 9u, 10u, 9u, 9u, 5u, 10u, 3u, 13u, 3u, 10u, 
+        5u, 10u, 3u, 10u, 3u, 13u, 3u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 
+        4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 
+        3u, 14u, 1u, 16u, 4u, 14u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 
+        1u, 16u, 1u, 16u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 
+        1u, 16u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 
+        3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 4u, 14u, 1u, 16u, 
+        3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 
+        3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 
+        3u, 17u, 3u, 17u, 4u, 17u, 5u, 14u, 5u, 14u, 5u, 10u, 9u, 10u, 9u, 9u, 
+        9u, 10u, 9u, 10u, 9u, 9u, 5u, 10u, 3u, 13u, 3u, 10u, 5u, 10u, 3u, 10u, 
+        3u, 13u, 3u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 
+        3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 1u, 16u, 
+        4u, 14u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 
+        3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u, 
+        3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u, 3u, 17u, 
+        1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 4u, 14u, 3u, 17u, 4u, 14u, 
+        3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 
+        3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 
+        3u, 17u, 3u, 17u, 4u, 17u, 5u, 14u, 5u, 14u, 5u, 10u, 9u, 10u, 9u, 9u, 
+        9u, 10u, 9u, 10u, 9u, 9u, 5u, 10u, 3u, 13u, 3u, 10u, 5u, 10u, 3u, 10u, 
+        3u, 13u, 3u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 
+        3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 1u, 16u, 
+        4u, 14u, 3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 
+        3u, 17u, 3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u, 
+        3u, 17u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u, 3u, 17u, 
+        1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 1u, 16u, 3u, 17u, 1u, 17u, 3u, 17u, 
+        1u, 17u, 4u, 14u, 5u, 10u, 9u, 10u, 9u, 9u, 9u, 10u, 9u, 10u, 9u, 9u, 
+        5u, 10u, 1u, 16u, 3u, 17u, 3u, 17u, 4u, 17u, 3u, 17u, 3u, 17u, 1u, 16u, 
+        3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 14u, 4u, 14u, 
+        5u, 14u, 3u, 14u, 4u, 14u, 5u, 14u, 3u, 13u, 3u, 10u, 5u, 10u, 3u, 10u, 
+        3u, 13u, 1u, 16u, 3u, 10u, 5u, 10u, 5u, 10u, 9u, 10u, 9u, 9u, 9u, 10u, 
         9u, 10u, 9u, 9u, 5u, 10u, 0
 };
 
 static const char _indic_syllable_machine_key_spans[] = {
-        1, 16, 6, 4, 3, 1, 4, 3,
-        1, 4, 3, 1, 4, 3, 1, 5,
-        1, 1, 5, 1, 1, 5, 1, 1,
-        5, 1, 1, 11, 11, 11, 11, 11,
-        11, 11, 11, 11, 11, 1, 16, 6,
-        4, 3, 1, 4, 3, 1, 4, 3,
-        1, 4, 3, 1, 5, 1, 1, 5,
-        1, 1, 5, 1, 1, 5, 1, 1,
-        11, 11, 11, 11, 11, 11, 11, 11,
-        11, 11, 1, 16, 6, 4, 3, 1,
-        4, 3, 1, 4, 3, 1, 4, 3,
-        1, 5, 1, 1, 5, 1, 1, 5,
-        1, 1, 5, 1, 1, 11, 11, 11,
-        11, 11, 11, 11, 11, 11, 1, 16,
-        6, 4, 3, 1, 4, 3, 1, 4,
-        3, 1, 4, 3, 1, 5, 1, 1,
-        5, 1, 1, 5, 1, 1, 5, 1,
-        1, 11, 11, 11, 11, 11, 11, 11,
-        11, 11, 11, 11, 4, 11, 11, 4,
-        3, 4, 3, 1, 4, 3, 1, 4,
-        3, 1, 1, 16, 6, 5, 1, 1,
-        5, 1, 1, 5, 1, 1, 5, 1,
-        1, 1, 18, 15, 15, 14, 16, 15,
-        15, 14, 16, 15, 15, 14, 16, 15,
-        15, 14, 16, 15, 15, 14, 10, 10,
-        6, 2, 1, 2, 2, 1, 6, 11,
-        8, 6, 8, 11, 12, 12, 11, 10,
-        12, 11, 10, 12, 11, 10, 12, 11,
-        10, 12, 16, 11, 15, 15, 16, 16,
-        16, 16, 16, 15, 15, 16, 16, 16,
-        16, 16, 15, 15, 16, 16, 16, 16,
-        16, 15, 15, 16, 16, 16, 16, 16,
-        15, 15, 15, 15, 14, 16, 15, 15,
-        14, 16, 15, 15, 14, 16, 15, 15,
-        14, 16, 15, 15, 14, 10, 10, 6,
-        2, 1, 2, 2, 1, 6, 11, 8,
-        6, 8, 11, 12, 12, 11, 10, 12,
-        11, 10, 12, 11, 10, 12, 11, 10,
-        12, 16, 11, 15, 15, 16, 16, 16,
-        16, 16, 15, 15, 16, 16, 16, 16,
-        16, 15, 15, 16, 16, 16, 16, 16,
-        15, 15, 16, 16, 16, 16, 11, 16,
-        15, 15, 14, 16, 15, 15, 14, 16,
-        15, 15, 14, 16, 15, 15, 14, 16,
-        15, 15, 14, 10, 10, 6, 2, 1,
-        2, 2, 1, 6, 11, 8, 6, 8,
-        11, 12, 12, 11, 10, 12, 11, 10,
-        12, 11, 10, 12, 11, 10, 12, 16,
-        11, 15, 15, 16, 16, 16, 16, 16,
-        15, 15, 16, 16, 16, 16, 16, 15,
-        15, 16, 16, 16, 16, 16, 15, 15,
-        16, 16, 16, 16, 16, 11, 15, 11,
-        15, 15, 14, 16, 15, 15, 14, 16,
-        15, 15, 14, 16, 15, 15, 14, 16,
-        15, 15, 14, 10, 10, 6, 2, 1,
-        2, 2, 1, 6, 11, 8, 6, 8,
-        11, 12, 12, 11, 10, 12, 11, 10,
-        12, 11, 10, 12, 11, 10, 12, 16,
-        11, 15, 15, 16, 16, 16, 16, 16,
-        15, 15, 16, 16, 16, 16, 16, 15,
-        15, 16, 16, 16, 16, 16, 15, 15,
-        16, 16, 16, 16, 16, 15, 17, 15,
-        17, 11, 6, 2, 1, 2, 2, 1,
-        6, 16, 15, 15, 14, 15, 15, 16,
-        12, 11, 10, 12, 11, 10, 12, 11,
-        10, 12, 11, 10, 11, 8, 6, 8,
-        11, 16, 8, 6, 6, 2, 1, 2,
+        1, 16, 6, 4, 3, 1, 4, 3, 
+        1, 4, 3, 1, 4, 3, 1, 5, 
+        1, 1, 5, 1, 1, 5, 1, 1, 
+        5, 1, 1, 11, 11, 11, 11, 11, 
+        11, 11, 11, 11, 11, 1, 16, 6, 
+        4, 3, 1, 4, 3, 1, 4, 3, 
+        1, 4, 3, 1, 5, 1, 1, 5, 
+        1, 1, 5, 1, 1, 5, 1, 1, 
+        11, 11, 11, 11, 11, 11, 11, 11, 
+        11, 11, 1, 16, 6, 4, 3, 1, 
+        4, 3, 1, 4, 3, 1, 4, 3, 
+        1, 5, 1, 1, 5, 1, 1, 5, 
+        1, 1, 5, 1, 1, 11, 11, 11, 
+        11, 11, 11, 11, 11, 11, 1, 16, 
+        6, 4, 3, 1, 4, 3, 1, 4, 
+        3, 1, 4, 3, 1, 5, 1, 1, 
+        5, 1, 1, 5, 1, 1, 5, 1, 
+        1, 11, 11, 11, 11, 11, 11, 11, 
+        11, 11, 11, 11, 4, 11, 11, 4, 
+        3, 4, 3, 1, 4, 3, 1, 4, 
+        3, 1, 1, 16, 6, 5, 1, 1, 
+        5, 1, 1, 5, 1, 1, 5, 1, 
+        1, 1, 18, 15, 15, 14, 16, 15, 
+        15, 14, 16, 15, 15, 14, 16, 15, 
+        15, 14, 16, 15, 15, 14, 10, 10, 
+        6, 2, 1, 2, 2, 1, 6, 11, 
+        8, 6, 8, 11, 12, 12, 11, 10, 
+        12, 11, 10, 12, 11, 10, 12, 11, 
+        10, 12, 16, 11, 15, 15, 16, 16, 
+        16, 16, 16, 15, 15, 16, 16, 16, 
+        16, 16, 15, 15, 16, 16, 16, 16, 
+        16, 15, 15, 16, 16, 16, 16, 16, 
+        15, 15, 15, 15, 14, 16, 15, 15, 
+        14, 16, 15, 15, 14, 16, 15, 15, 
+        14, 16, 15, 15, 14, 10, 10, 6, 
+        2, 1, 2, 2, 1, 6, 11, 8, 
+        6, 8, 11, 12, 12, 11, 10, 12, 
+        11, 10, 12, 11, 10, 12, 11, 10, 
+        12, 16, 11, 15, 15, 16, 16, 16, 
+        16, 16, 15, 15, 16, 16, 16, 16, 
+        16, 15, 15, 16, 16, 16, 16, 16, 
+        15, 15, 16, 16, 16, 16, 11, 16, 
+        15, 15, 14, 16, 15, 15, 14, 16, 
+        15, 15, 14, 16, 15, 15, 14, 16, 
+        15, 15, 14, 10, 10, 6, 2, 1, 
+        2, 2, 1, 6, 11, 8, 6, 8, 
+        11, 12, 12, 11, 10, 12, 11, 10, 
+        12, 11, 10, 12, 11, 10, 12, 16, 
+        11, 15, 15, 16, 16, 16, 16, 16, 
+        15, 15, 16, 16, 16, 16, 16, 15, 
+        15, 16, 16, 16, 16, 16, 15, 15, 
+        16, 16, 16, 16, 16, 11, 15, 11, 
+        15, 15, 14, 16, 15, 15, 14, 16, 
+        15, 15, 14, 16, 15, 15, 14, 16, 
+        15, 15, 14, 10, 10, 6, 2, 1, 
+        2, 2, 1, 6, 11, 8, 6, 8, 
+        11, 12, 12, 11, 10, 12, 11, 10, 
+        12, 11, 10, 12, 11, 10, 12, 16, 
+        11, 15, 15, 16, 16, 16, 16, 16, 
+        15, 15, 16, 16, 16, 16, 16, 15, 
+        15, 16, 16, 16, 16, 16, 15, 15, 
+        16, 16, 16, 16, 16, 15, 17, 15, 
+        17, 11, 6, 2, 1, 2, 2, 1, 
+        6, 16, 15, 15, 14, 15, 15, 16, 
+        12, 11, 10, 12, 11, 10, 12, 11, 
+        10, 12, 11, 10, 11, 8, 6, 8, 
+        11, 16, 8, 6, 6, 2, 1, 2, 
         2, 1, 6
 };
 
 static const short _indic_syllable_machine_index_offsets[] = {
-        0, 2, 19, 26, 31, 35, 37, 42,
-        46, 48, 53, 57, 59, 64, 68, 70,
-        76, 78, 80, 86, 88, 90, 96, 98,
-        100, 106, 108, 110, 122, 134, 146, 158,
-        170, 182, 194, 206, 218, 230, 232, 249,
-        256, 261, 265, 267, 272, 276, 278, 283,
-        287, 289, 294, 298, 300, 306, 308, 310,
-        316, 318, 320, 326, 328, 330, 336, 338,
-        340, 352, 364, 376, 388, 400, 412, 424,
-        436, 448, 460, 462, 479, 486, 491, 495,
-        497, 502, 506, 508, 513, 517, 519, 524,
-        528, 530, 536, 538, 540, 546, 548, 550,
-        556, 558, 560, 566, 568, 570, 582, 594,
-        606, 618, 630, 642, 654, 666, 678, 680,
-        697, 704, 709, 713, 715, 720, 724, 726,
-        731, 735, 737, 742, 746, 748, 754, 756,
-        758, 764, 766, 768, 774, 776, 778, 784,
-        786, 788, 800, 812, 824, 836, 848, 860,
-        872, 884, 896, 908, 920, 925, 937, 949,
-        954, 958, 963, 967, 969, 974, 978, 980,
-        985, 989, 991, 993, 1010, 1017, 1023, 1025,
-        1027, 1033, 1035, 1037, 1043, 1045, 1047, 1053,
-        1055, 1057, 1059, 1078, 1094, 1110, 1125, 1142,
-        1158, 1174, 1189, 1206, 1222, 1238, 1253, 1270,
-        1286, 1302, 1317, 1334, 1350, 1366, 1381, 1392,
-        1403, 1410, 1413, 1415, 1418, 1421, 1423, 1430,
-        1442, 1451, 1458, 1467, 1479, 1492, 1505, 1517,
-        1528, 1541, 1553, 1564, 1577, 1589, 1600, 1613,
-        1625, 1636, 1649, 1666, 1678, 1694, 1710, 1727,
-        1744, 1761, 1778, 1795, 1811, 1827, 1844, 1861,
-        1878, 1895, 1912, 1928, 1944, 1961, 1978, 1995,
-        2012, 2029, 2045, 2061, 2078, 2095, 2112, 2129,
-        2146, 2162, 2178, 2194, 2210, 2225, 2242, 2258,
-        2274, 2289, 2306, 2322, 2338, 2353, 2370, 2386,
-        2402, 2417, 2434, 2450, 2466, 2481, 2492, 2503,
-        2510, 2513, 2515, 2518, 2521, 2523, 2530, 2542,
-        2551, 2558, 2567, 2579, 2592, 2605, 2617, 2628,
-        2641, 2653, 2664, 2677, 2689, 2700, 2713, 2725,
-        2736, 2749, 2766, 2778, 2794, 2810, 2827, 2844,
-        2861, 2878, 2895, 2911, 2927, 2944, 2961, 2978,
-        2995, 3012, 3028, 3044, 3061, 3078, 3095, 3112,
-        3129, 3145, 3161, 3178, 3195, 3212, 3229, 3241,
-        3258, 3274, 3290, 3305, 3322, 3338, 3354, 3369,
-        3386, 3402, 3418, 3433, 3450, 3466, 3482, 3497,
-        3514, 3530, 3546, 3561, 3572, 3583, 3590, 3593,
-        3595, 3598, 3601, 3603, 3610, 3622, 3631, 3638,
-        3647, 3659, 3672, 3685, 3697, 3708, 3721, 3733,
-        3744, 3757, 3769, 3780, 3793, 3805, 3816, 3829,
-        3846, 3858, 3874, 3890, 3907, 3924, 3941, 3958,
-        3975, 3991, 4007, 4024, 4041, 4058, 4075, 4092,
-        4108, 4124, 4141, 4158, 4175, 4192, 4209, 4225,
-        4241, 4258, 4275, 4292, 4309, 4326, 4338, 4354,
-        4366, 4382, 4398, 4413, 4430, 4446, 4462, 4477,
-        4494, 4510, 4526, 4541, 4558, 4574, 4590, 4605,
-        4622, 4638, 4654, 4669, 4680, 4691, 4698, 4701,
-        4703, 4706, 4709, 4711, 4718, 4730, 4739, 4746,
-        4755, 4767, 4780, 4793, 4805, 4816, 4829, 4841,
-        4852, 4865, 4877, 4888, 4901, 4913, 4924, 4937,
-        4954, 4966, 4982, 4998, 5015, 5032, 5049, 5066,
-        5083, 5099, 5115, 5132, 5149, 5166, 5183, 5200,
-        5216, 5232, 5249, 5266, 5283, 5300, 5317, 5333,
-        5349, 5366, 5383, 5400, 5417, 5434, 5450, 5468,
-        5484, 5502, 5514, 5521, 5524, 5526, 5529, 5532,
-        5534, 5541, 5558, 5574, 5590, 5605, 5621, 5637,
-        5654, 5667, 5679, 5690, 5703, 5715, 5726, 5739,
-        5751, 5762, 5775, 5787, 5798, 5810, 5819, 5826,
-        5835, 5847, 5864, 5873, 5880, 5887, 5890, 5892,
+        0, 2, 19, 26, 31, 35, 37, 42, 
+        46, 48, 53, 57, 59, 64, 68, 70, 
+        76, 78, 80, 86, 88, 90, 96, 98, 
+        100, 106, 108, 110, 122, 134, 146, 158, 
+        170, 182, 194, 206, 218, 230, 232, 249, 
+        256, 261, 265, 267, 272, 276, 278, 283, 
+        287, 289, 294, 298, 300, 306, 308, 310, 
+        316, 318, 320, 326, 328, 330, 336, 338, 
+        340, 352, 364, 376, 388, 400, 412, 424, 
+        436, 448, 460, 462, 479, 486, 491, 495, 
+        497, 502, 506, 508, 513, 517, 519, 524, 
+        528, 530, 536, 538, 540, 546, 548, 550, 
+        556, 558, 560, 566, 568, 570, 582, 594, 
+        606, 618, 630, 642, 654, 666, 678, 680, 
+        697, 704, 709, 713, 715, 720, 724, 726, 
+        731, 735, 737, 742, 746, 748, 754, 756, 
+        758, 764, 766, 768, 774, 776, 778, 784, 
+        786, 788, 800, 812, 824, 836, 848, 860, 
+        872, 884, 896, 908, 920, 925, 937, 949, 
+        954, 958, 963, 967, 969, 974, 978, 980, 
+        985, 989, 991, 993, 1010, 1017, 1023, 1025, 
+        1027, 1033, 1035, 1037, 1043, 1045, 1047, 1053, 
+        1055, 1057, 1059, 1078, 1094, 1110, 1125, 1142, 
+        1158, 1174, 1189, 1206, 1222, 1238, 1253, 1270, 
+        1286, 1302, 1317, 1334, 1350, 1366, 1381, 1392, 
+        1403, 1410, 1413, 1415, 1418, 1421, 1423, 1430, 
+        1442, 1451, 1458, 1467, 1479, 1492, 1505, 1517, 
+        1528, 1541, 1553, 1564, 1577, 1589, 1600, 1613, 
+        1625, 1636, 1649, 1666, 1678, 1694, 1710, 1727, 
+        1744, 1761, 1778, 1795, 1811, 1827, 1844, 1861, 
+        1878, 1895, 1912, 1928, 1944, 1961, 1978, 1995, 
+        2012, 2029, 2045, 2061, 2078, 2095, 2112, 2129, 
+        2146, 2162, 2178, 2194, 2210, 2225, 2242, 2258, 
+        2274, 2289, 2306, 2322, 2338, 2353, 2370, 2386, 
+        2402, 2417, 2434, 2450, 2466, 2481, 2492, 2503, 
+        2510, 2513, 2515, 2518, 2521, 2523, 2530, 2542, 
+        2551, 2558, 2567, 2579, 2592, 2605, 2617, 2628, 
+        2641, 2653, 2664, 2677, 2689, 2700, 2713, 2725, 
+        2736, 2749, 2766, 2778, 2794, 2810, 2827, 2844, 
+        2861, 2878, 2895, 2911, 2927, 2944, 2961, 2978, 
+        2995, 3012, 3028, 3044, 3061, 3078, 3095, 3112, 
+        3129, 3145, 3161, 3178, 3195, 3212, 3229, 3241, 
+        3258, 3274, 3290, 3305, 3322, 3338, 3354, 3369, 
+        3386, 3402, 3418, 3433, 3450, 3466, 3482, 3497, 
+        3514, 3530, 3546, 3561, 3572, 3583, 3590, 3593, 
+        3595, 3598, 3601, 3603, 3610, 3622, 3631, 3638, 
+        3647, 3659, 3672, 3685, 3697, 3708, 3721, 3733, 
+        3744, 3757, 3769, 3780, 3793, 3805, 3816, 3829, 
+        3846, 3858, 3874, 3890, 3907, 3924, 3941, 3958, 
+        3975, 3991, 4007, 4024, 4041, 4058, 4075, 4092, 
+        4108, 4124, 4141, 4158, 4175, 4192, 4209, 4225, 
+        4241, 4258, 4275, 4292, 4309, 4326, 4338, 4354, 
+        4366, 4382, 4398, 4413, 4430, 4446, 4462, 4477, 
+        4494, 4510, 4526, 4541, 4558, 4574, 4590, 4605, 
+        4622, 4638, 4654, 4669, 4680, 4691, 4698, 4701, 
+        4703, 4706, 4709, 4711, 4718, 4730, 4739, 4746, 
+        4755, 4767, 4780, 4793, 4805, 4816, 4829, 4841, 
+        4852, 4865, 4877, 4888, 4901, 4913, 4924, 4937, 
+        4954, 4966, 4982, 4998, 5015, 5032, 5049, 5066, 
+        5083, 5099, 5115, 5132, 5149, 5166, 5183, 5200, 
+        5216, 5232, 5249, 5266, 5283, 5300, 5317, 5333, 
+        5349, 5366, 5383, 5400, 5417, 5434, 5450, 5468, 
+        5484, 5502, 5514, 5521, 5524, 5526, 5529, 5532, 
+        5534, 5541, 5558, 5574, 5590, 5605, 5621, 5637, 
+        5654, 5667, 5679, 5690, 5703, 5715, 5726, 5739, 
+        5751, 5762, 5775, 5787, 5798, 5810, 5819, 5826, 
+        5835, 5847, 5864, 5873, 5880, 5887, 5890, 5892, 
         5895, 5898, 5900
 };
 
 static const short _indic_syllable_machine_indicies[] = {
-        1, 0, 2, 3, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 2, 0, 1, 0, 0, 0, 0,
-        4, 0, 5, 5, 6, 1, 0, 7,
-        7, 6, 0, 6, 0, 8, 8, 9,
-        1, 0, 10, 10, 9, 0, 9, 0,
-        11, 11, 12, 1, 0, 13, 13, 12,
-        0, 12, 0, 14, 14, 15, 1, 0,
-        16, 16, 15, 0, 15, 0, 17, 0,
-        0, 0, 1, 0, 18, 0, 19, 0,
-        20, 14, 14, 15, 1, 0, 21, 0,
-        22, 0, 23, 11, 11, 12, 1, 0,
-        24, 0, 25, 0, 26, 8, 8, 9,
-        1, 0, 27, 0, 28, 0, 29, 5,
-        5, 6, 1, 0, 0, 0, 0, 0,
-        29, 0, 29, 5, 5, 6, 1, 0,
-        0, 0, 0, 30, 29, 0, 31, 5,
-        5, 6, 1, 0, 0, 0, 0, 0,
-        31, 0, 31, 5, 5, 6, 1, 0,
-        0, 0, 0, 32, 31, 0, 33, 5,
-        5, 6, 1, 0, 0, 0, 0, 0,
-        33, 0, 33, 5, 5, 6, 1, 0,
-        0, 0, 0, 34, 33, 0, 35, 5,
-        5, 6, 1, 0, 0, 0, 0, 0,
-        35, 0, 35, 5, 5, 6, 1, 0,
-        0, 0, 0, 36, 35, 0, 37, 5,
-        5, 6, 1, 0, 0, 0, 0, 0,
-        37, 0, 37, 5, 5, 6, 1, 0,
-        0, 0, 0, 38, 37, 0, 40, 39,
-        41, 42, 39, 39, 39, 39, 39, 39,
-        39, 39, 39, 39, 39, 39, 39, 41,
-        39, 40, 39, 39, 39, 39, 43, 39,
-        44, 44, 45, 40, 39, 46, 46, 45,
-        39, 45, 39, 47, 47, 48, 40, 39,
-        49, 49, 48, 39, 48, 39, 50, 50,
-        51, 40, 39, 52, 52, 51, 39, 51,
-        39, 53, 53, 54, 40, 39, 55, 55,
-        54, 39, 54, 39, 56, 39, 39, 39,
-        40, 39, 57, 39, 58, 39, 59, 53,
-        53, 54, 40, 39, 60, 39, 61, 39,
-        62, 50, 50, 51, 40, 39, 63, 39,
-        64, 39, 65, 47, 47, 48, 40, 39,
-        66, 39, 67, 39, 68, 44, 44, 45,
-        40, 39, 39, 39, 39, 39, 68, 39,
-        68, 44, 44, 45, 40, 39, 39, 39,
-        39, 69, 68, 39, 70, 44, 44, 45,
-        40, 39, 39, 39, 39, 39, 70, 39,
-        70, 44, 44, 45, 40, 39, 39, 39,
-        39, 71, 70, 39, 72, 44, 44, 45,
-        40, 39, 39, 39, 39, 39, 72, 39,
-        72, 44, 44, 45, 40, 39, 39, 39,
-        39, 73, 72, 39, 74, 44, 44, 45,
-        40, 39, 39, 39, 39, 39, 74, 39,
-        74, 44, 44, 45, 40, 39, 39, 39,
-        39, 75, 74, 39, 76, 44, 44, 45,
-        40, 39, 39, 39, 39, 39, 76, 39,
-        76, 44, 44, 45, 40, 39, 39, 39,
-        39, 77, 76, 39, 79, 78, 80, 81,
-        78, 78, 78, 78, 78, 78, 78, 78,
-        78, 78, 78, 78, 78, 80, 78, 79,
-        78, 78, 78, 78, 82, 78, 83, 83,
-        84, 79, 78, 86, 86, 84, 85, 84,
-        85, 87, 87, 88, 79, 78, 89, 89,
-        88, 78, 88, 78, 90, 90, 91, 79,
-        78, 92, 92, 91, 78, 91, 78, 93,
-        93, 94, 79, 78, 95, 95, 94, 78,
-        94, 78, 96, 78, 78, 78, 79, 78,
-        97, 78, 98, 78, 99, 93, 93, 94,
-        79, 78, 100, 78, 101, 78, 102, 90,
-        90, 91, 79, 78, 103, 78, 104, 78,
-        105, 87, 87, 88, 79, 78, 106, 78,
-        107, 78, 108, 83, 83, 84, 79, 78,
-        78, 78, 78, 78, 108, 78, 108, 83,
-        83, 84, 79, 78, 78, 78, 78, 109,
-        108, 78, 110, 83, 83, 84, 79, 78,
-        78, 78, 78, 78, 110, 78, 110, 83,
-        83, 84, 79, 78, 78, 78, 78, 111,
-        110, 78, 112, 83, 83, 84, 79, 78,
-        78, 78, 78, 78, 112, 78, 112, 83,
-        83, 84, 79, 78, 78, 78, 78, 113,
-        112, 78, 114, 83, 83, 84, 79, 78,
-        78, 78, 78, 78, 114, 78, 114, 83,
-        83, 84, 79, 78, 78, 78, 78, 115,
-        114, 78, 116, 83, 83, 84, 79, 78,
-        78, 78, 78, 78, 116, 78, 118, 117,
-        119, 120, 117, 117, 117, 117, 117, 117,
-        117, 117, 117, 117, 117, 117, 117, 119,
-        117, 118, 117, 117, 117, 117, 121, 117,
-        122, 122, 123, 118, 117, 124, 124, 123,
-        117, 123, 117, 125, 125, 126, 118, 117,
-        127, 127, 126, 117, 126, 117, 128, 128,
-        129, 118, 117, 130, 130, 129, 117, 129,
-        117, 131, 131, 132, 118, 117, 133, 133,
-        132, 117, 132, 117, 134, 117, 117, 117,
-        118, 117, 135, 117, 136, 117, 137, 131,
-        131, 132, 118, 117, 138, 117, 139, 117,
-        140, 128, 128, 129, 118, 117, 141, 117,
-        142, 117, 143, 125, 125, 126, 118, 117,
-        144, 117, 145, 117, 146, 122, 122, 123,
-        118, 117, 117, 117, 117, 117, 146, 117,
-        146, 122, 122, 123, 118, 117, 117, 117,
-        117, 147, 146, 117, 148, 122, 122, 123,
-        118, 117, 117, 117, 117, 117, 148, 117,
-        148, 122, 122, 123, 118, 117, 117, 117,
-        117, 149, 148, 117, 150, 122, 122, 123,
-        118, 117, 117, 117, 117, 117, 150, 117,
-        150, 122, 122, 123, 118, 117, 117, 117,
-        117, 151, 150, 117, 152, 122, 122, 123,
-        118, 117, 117, 117, 117, 117, 152, 117,
-        152, 122, 122, 123, 118, 117, 117, 117,
-        117, 153, 152, 117, 154, 122, 122, 123,
-        118, 117, 117, 117, 117, 117, 154, 117,
-        154, 122, 122, 123, 118, 117, 117, 117,
-        117, 155, 154, 117, 116, 83, 83, 84,
-        79, 78, 78, 78, 78, 156, 116, 78,
-        86, 86, 84, 1, 0, 114, 83, 83,
-        84, 157, 0, 0, 0, 0, 0, 114,
-        0, 114, 83, 83, 84, 157, 0, 0,
-        0, 0, 158, 114, 0, 159, 159, 160,
-        1, 0, 7, 7, 160, 0, 161, 161,
-        162, 157, 0, 163, 163, 162, 0, 162,
-        0, 164, 164, 165, 157, 0, 166, 166,
-        165, 0, 165, 0, 167, 167, 168, 157,
-        0, 169, 169, 168, 0, 168, 0, 157,
-        0, 170, 171, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        170, 0, 157, 0, 0, 0, 0, 172,
-        0, 173, 0, 0, 0, 157, 0, 174,
-        0, 175, 0, 176, 167, 167, 168, 157,
-        0, 177, 0, 178, 0, 179, 164, 164,
-        165, 157, 0, 180, 0, 181, 0, 182,
-        161, 161, 162, 157, 0, 183, 0, 184,
-        0, 186, 185, 188, 189, 190, 191, 192,
-        193, 84, 79, 194, 195, 196, 196, 156,
-        197, 198, 199, 200, 201, 187, 203, 204,
-        205, 206, 6, 1, 207, 208, 202, 202,
-        38, 209, 202, 202, 210, 202, 211, 204,
-        212, 212, 6, 1, 207, 208, 202, 202,
-        202, 209, 202, 202, 210, 202, 204, 212,
-        212, 6, 1, 207, 208, 202, 202, 202,
-        209, 202, 202, 210, 202, 213, 202, 202,
-        202, 19, 214, 202, 1, 207, 208, 202,
-        202, 202, 215, 202, 213, 202, 216, 217,
-        218, 219, 6, 1, 207, 208, 202, 202,
-        36, 220, 202, 202, 210, 202, 221, 217,
-        222, 222, 6, 1, 207, 208, 202, 202,
-        202, 220, 202, 202, 210, 202, 217, 222,
-        222, 6, 1, 207, 208, 202, 202, 202,
-        220, 202, 202, 210, 202, 223, 202, 202,
-        202, 19, 224, 202, 1, 207, 208, 202,
-        202, 202, 215, 202, 223, 202, 225, 226,
-        227, 228, 6, 1, 207, 208, 202, 202,
-        34, 229, 202, 202, 210, 202, 230, 226,
-        231, 231, 6, 1, 207, 208, 202, 202,
-        202, 229, 202, 202, 210, 202, 226, 231,
-        231, 6, 1, 207, 208, 202, 202, 202,
-        229, 202, 202, 210, 202, 232, 202, 202,
-        202, 19, 233, 202, 1, 207, 208, 202,
-        202, 202, 215, 202, 232, 202, 234, 235,
-        236, 237, 6, 1, 207, 208, 202, 202,
-        32, 238, 202, 202, 210, 202, 239, 235,
-        240, 240, 6, 1, 207, 208, 202, 202,
-        202, 238, 202, 202, 210, 202, 235, 240,
-        240, 6, 1, 207, 208, 202, 202, 202,
-        238, 202, 202, 210, 202, 241, 202, 202,
-        202, 19, 242, 202, 1, 207, 208, 202,
-        202, 202, 215, 202, 241, 202, 243, 244,
-        245, 246, 6, 1, 207, 208, 202, 202,
-        30, 247, 202, 202, 210, 202, 248, 244,
-        249, 249, 6, 1, 207, 208, 202, 202,
-        202, 247, 202, 202, 210, 202, 244, 249,
-        249, 6, 1, 207, 208, 202, 202, 202,
-        247, 202, 202, 210, 202, 19, 250, 202,
-        1, 207, 208, 202, 202, 202, 215, 202,
-        251, 251, 202, 1, 207, 208, 202, 202,
-        202, 215, 202, 252, 202, 202, 253, 207,
-        208, 202, 207, 208, 202, 254, 202, 207,
-        255, 202, 207, 256, 202, 207, 202, 252,
-        202, 202, 202, 207, 208, 202, 257, 202,
-        258, 259, 202, 1, 207, 208, 202, 202,
-        4, 202, 3, 202, 251, 251, 202, 1,
-        207, 208, 202, 251, 251, 202, 1, 207,
-        208, 202, 257, 202, 251, 251, 202, 1,
-        207, 208, 202, 257, 202, 258, 251, 202,
-        1, 207, 208, 202, 202, 4, 202, 19,
-        202, 260, 260, 6, 1, 207, 208, 202,
-        202, 202, 215, 202, 261, 28, 262, 263,
-        9, 1, 207, 208, 202, 202, 202, 215,
-        202, 28, 262, 263, 9, 1, 207, 208,
-        202, 202, 202, 215, 202, 262, 262, 9,
-        1, 207, 208, 202, 202, 202, 215, 202,
-        264, 25, 265, 266, 12, 1, 207, 208,
-        202, 202, 202, 215, 202, 25, 265, 266,
-        12, 1, 207, 208, 202, 202, 202, 215,
-        202, 265, 265, 12, 1, 207, 208, 202,
-        202, 202, 215, 202, 267, 22, 268, 269,
-        15, 1, 207, 208, 202, 202, 202, 215,
-        202, 22, 268, 269, 15, 1, 207, 208,
-        202, 202, 202, 215, 202, 268, 268, 15,
-        1, 207, 208, 202, 202, 202, 215, 202,
-        270, 19, 251, 271, 202, 1, 207, 208,
-        202, 202, 202, 215, 202, 19, 251, 271,
-        202, 1, 207, 208, 202, 202, 202, 215,
-        202, 251, 272, 202, 1, 207, 208, 202,
-        202, 202, 215, 202, 19, 202, 251, 251,
-        202, 1, 207, 208, 202, 202, 202, 215,
-        202, 2, 3, 202, 202, 19, 250, 202,
-        1, 207, 208, 202, 202, 202, 215, 202,
-        2, 202, 244, 249, 249, 6, 1, 207,
-        208, 202, 202, 202, 247, 202, 243, 244,
-        249, 249, 6, 1, 207, 208, 202, 202,
-        202, 247, 202, 202, 210, 202, 243, 244,
-        245, 249, 6, 1, 207, 208, 202, 202,
-        30, 247, 202, 202, 210, 202, 241, 202,
-        273, 202, 260, 260, 6, 1, 207, 208,
-        202, 202, 202, 215, 202, 241, 202, 241,
-        202, 202, 202, 251, 251, 202, 1, 207,
-        208, 202, 202, 202, 215, 202, 241, 202,
-        241, 202, 202, 202, 251, 274, 202, 1,
-        207, 208, 202, 202, 202, 215, 202, 241,
-        202, 241, 202, 273, 202, 251, 251, 202,
-        1, 207, 208, 202, 202, 202, 215, 202,
-        241, 202, 241, 3, 202, 202, 19, 242,
-        202, 1, 207, 208, 202, 202, 202, 215,
-        202, 241, 202, 234, 235, 240, 240, 6,
-        1, 207, 208, 202, 202, 202, 238, 202,
-        202, 210, 202, 234, 235, 236, 240, 6,
-        1, 207, 208, 202, 202, 32, 238, 202,
-        202, 210, 202, 232, 202, 275, 202, 260,
-        260, 6, 1, 207, 208, 202, 202, 202,
-        215, 202, 232, 202, 232, 202, 202, 202,
-        251, 251, 202, 1, 207, 208, 202, 202,
-        202, 215, 202, 232, 202, 232, 202, 202,
-        202, 251, 276, 202, 1, 207, 208, 202,
-        202, 202, 215, 202, 232, 202, 232, 202,
-        275, 202, 251, 251, 202, 1, 207, 208,
-        202, 202, 202, 215, 202, 232, 202, 232,
-        3, 202, 202, 19, 233, 202, 1, 207,
-        208, 202, 202, 202, 215, 202, 232, 202,
-        225, 226, 231, 231, 6, 1, 207, 208,
-        202, 202, 202, 229, 202, 202, 210, 202,
-        225, 226, 227, 231, 6, 1, 207, 208,
-        202, 202, 34, 229, 202, 202, 210, 202,
-        223, 202, 277, 202, 260, 260, 6, 1,
-        207, 208, 202, 202, 202, 215, 202, 223,
-        202, 223, 202, 202, 202, 251, 251, 202,
-        1, 207, 208, 202, 202, 202, 215, 202,
-        223, 202, 223, 202, 202, 202, 251, 278,
-        202, 1, 207, 208, 202, 202, 202, 215,
-        202, 223, 202, 223, 202, 277, 202, 251,
-        251, 202, 1, 207, 208, 202, 202, 202,
-        215, 202, 223, 202, 223, 3, 202, 202,
-        19, 224, 202, 1, 207, 208, 202, 202,
-        202, 215, 202, 223, 202, 216, 217, 222,
-        222, 6, 1, 207, 208, 202, 202, 202,
-        220, 202, 202, 210, 202, 216, 217, 218,
-        222, 6, 1, 207, 208, 202, 202, 36,
-        220, 202, 202, 210, 202, 213, 202, 279,
-        202, 260, 260, 6, 1, 207, 208, 202,
-        202, 202, 215, 202, 213, 202, 213, 202,
-        202, 202, 251, 251, 202, 1, 207, 208,
-        202, 202, 202, 215, 202, 213, 202, 213,
-        202, 202, 202, 251, 280, 202, 1, 207,
-        208, 202, 202, 202, 215, 202, 213, 202,
-        213, 202, 279, 202, 251, 251, 202, 1,
-        207, 208, 202, 202, 202, 215, 202, 213,
-        202, 213, 3, 202, 202, 19, 214, 202,
-        1, 207, 208, 202, 202, 202, 215, 202,
-        213, 202, 203, 204, 212, 212, 6, 1,
-        207, 208, 202, 202, 202, 209, 202, 202,
-        210, 202, 203, 204, 205, 212, 6, 1,
-        207, 208, 202, 202, 38, 209, 202, 202,
-        210, 202, 282, 283, 284, 285, 45, 40,
-        286, 287, 281, 281, 77, 288, 281, 281,
-        289, 281, 290, 283, 291, 285, 45, 40,
-        286, 287, 281, 281, 281, 288, 281, 281,
-        289, 281, 283, 291, 285, 45, 40, 286,
-        287, 281, 281, 281, 288, 281, 281, 289,
-        281, 292, 281, 281, 281, 58, 293, 281,
-        40, 286, 287, 281, 281, 281, 294, 281,
-        292, 281, 295, 296, 297, 298, 45, 40,
-        286, 287, 281, 281, 75, 299, 281, 281,
-        289, 281, 300, 296, 301, 301, 45, 40,
-        286, 287, 281, 281, 281, 299, 281, 281,
-        289, 281, 296, 301, 301, 45, 40, 286,
-        287, 281, 281, 281, 299, 281, 281, 289,
-        281, 302, 281, 281, 281, 58, 303, 281,
-        40, 286, 287, 281, 281, 281, 294, 281,
-        302, 281, 304, 305, 306, 307, 45, 40,
-        286, 287, 281, 281, 73, 308, 281, 281,
-        289, 281, 309, 305, 310, 310, 45, 40,
-        286, 287, 281, 281, 281, 308, 281, 281,
-        289, 281, 305, 310, 310, 45, 40, 286,
-        287, 281, 281, 281, 308, 281, 281, 289,
-        281, 311, 281, 281, 281, 58, 312, 281,
-        40, 286, 287, 281, 281, 281, 294, 281,
-        311, 281, 313, 314, 315, 316, 45, 40,
-        286, 287, 281, 281, 71, 317, 281, 281,
-        289, 281, 318, 314, 319, 319, 45, 40,
-        286, 287, 281, 281, 281, 317, 281, 281,
-        289, 281, 314, 319, 319, 45, 40, 286,
-        287, 281, 281, 281, 317, 281, 281, 289,
-        281, 320, 281, 281, 281, 58, 321, 281,
-        40, 286, 287, 281, 281, 281, 294, 281,
-        320, 281, 322, 323, 324, 325, 45, 40,
-        286, 287, 281, 281, 69, 326, 281, 281,
-        289, 281, 327, 323, 328, 328, 45, 40,
-        286, 287, 281, 281, 281, 326, 281, 281,
-        289, 281, 323, 328, 328, 45, 40, 286,
-        287, 281, 281, 281, 326, 281, 281, 289,
-        281, 58, 329, 281, 40, 286, 287, 281,
-        281, 281, 294, 281, 330, 330, 281, 40,
-        286, 287, 281, 281, 281, 294, 281, 331,
-        281, 281, 332, 286, 287, 281, 286, 287,
-        281, 333, 281, 286, 334, 281, 286, 335,
-        281, 286, 281, 331, 281, 281, 281, 286,
-        287, 281, 336, 281, 337, 338, 281, 40,
-        286, 287, 281, 281, 43, 281, 42, 281,
-        330, 330, 281, 40, 286, 287, 281, 330,
-        330, 281, 40, 286, 287, 281, 336, 281,
-        330, 330, 281, 40, 286, 287, 281, 336,
-        281, 337, 330, 281, 40, 286, 287, 281,
-        281, 43, 281, 58, 281, 339, 339, 45,
-        40, 286, 287, 281, 281, 281, 294, 281,
-        340, 67, 341, 342, 48, 40, 286, 287,
-        281, 281, 281, 294, 281, 67, 341, 342,
-        48, 40, 286, 287, 281, 281, 281, 294,
-        281, 341, 341, 48, 40, 286, 287, 281,
-        281, 281, 294, 281, 343, 64, 344, 345,
-        51, 40, 286, 287, 281, 281, 281, 294,
-        281, 64, 344, 345, 51, 40, 286, 287,
-        281, 281, 281, 294, 281, 344, 344, 51,
-        40, 286, 287, 281, 281, 281, 294, 281,
-        346, 61, 347, 348, 54, 40, 286, 287,
-        281, 281, 281, 294, 281, 61, 347, 348,
-        54, 40, 286, 287, 281, 281, 281, 294,
-        281, 347, 347, 54, 40, 286, 287, 281,
-        281, 281, 294, 281, 349, 58, 330, 350,
-        281, 40, 286, 287, 281, 281, 281, 294,
-        281, 58, 330, 350, 281, 40, 286, 287,
-        281, 281, 281, 294, 281, 330, 351, 281,
-        40, 286, 287, 281, 281, 281, 294, 281,
-        58, 281, 330, 330, 281, 40, 286, 287,
-        281, 281, 281, 294, 281, 41, 42, 281,
-        281, 58, 329, 281, 40, 286, 287, 281,
-        281, 281, 294, 281, 41, 281, 323, 328,
-        328, 45, 40, 286, 287, 281, 281, 281,
-        326, 281, 322, 323, 328, 328, 45, 40,
-        286, 287, 281, 281, 281, 326, 281, 281,
-        289, 281, 322, 323, 324, 328, 45, 40,
-        286, 287, 281, 281, 69, 326, 281, 281,
-        289, 281, 320, 281, 352, 281, 339, 339,
-        45, 40, 286, 287, 281, 281, 281, 294,
-        281, 320, 281, 320, 281, 281, 281, 330,
-        330, 281, 40, 286, 287, 281, 281, 281,
-        294, 281, 320, 281, 320, 281, 281, 281,
-        330, 353, 281, 40, 286, 287, 281, 281,
-        281, 294, 281, 320, 281, 320, 281, 352,
-        281, 330, 330, 281, 40, 286, 287, 281,
-        281, 281, 294, 281, 320, 281, 320, 42,
-        281, 281, 58, 321, 281, 40, 286, 287,
-        281, 281, 281, 294, 281, 320, 281, 313,
-        314, 319, 319, 45, 40, 286, 287, 281,
-        281, 281, 317, 281, 281, 289, 281, 313,
-        314, 315, 319, 45, 40, 286, 287, 281,
-        281, 71, 317, 281, 281, 289, 281, 311,
-        281, 354, 281, 339, 339, 45, 40, 286,
-        287, 281, 281, 281, 294, 281, 311, 281,
-        311, 281, 281, 281, 330, 330, 281, 40,
-        286, 287, 281, 281, 281, 294, 281, 311,
-        281, 311, 281, 281, 281, 330, 355, 281,
-        40, 286, 287, 281, 281, 281, 294, 281,
-        311, 281, 311, 281, 354, 281, 330, 330,
-        281, 40, 286, 287, 281, 281, 281, 294,
-        281, 311, 281, 311, 42, 281, 281, 58,
-        312, 281, 40, 286, 287, 281, 281, 281,
-        294, 281, 311, 281, 304, 305, 310, 310,
-        45, 40, 286, 287, 281, 281, 281, 308,
-        281, 281, 289, 281, 304, 305, 306, 310,
-        45, 40, 286, 287, 281, 281, 73, 308,
-        281, 281, 289, 281, 302, 281, 356, 281,
-        339, 339, 45, 40, 286, 287, 281, 281,
-        281, 294, 281, 302, 281, 302, 281, 281,
-        281, 330, 330, 281, 40, 286, 287, 281,
-        281, 281, 294, 281, 302, 281, 302, 281,
-        281, 281, 330, 357, 281, 40, 286, 287,
-        281, 281, 281, 294, 281, 302, 281, 302,
-        281, 356, 281, 330, 330, 281, 40, 286,
-        287, 281, 281, 281, 294, 281, 302, 281,
-        302, 42, 281, 281, 58, 303, 281, 40,
-        286, 287, 281, 281, 281, 294, 281, 302,
-        281, 295, 296, 301, 301, 45, 40, 286,
-        287, 281, 281, 281, 299, 281, 281, 289,
-        281, 295, 296, 297, 301, 45, 40, 286,
-        287, 281, 281, 75, 299, 281, 281, 289,
-        281, 292, 281, 358, 281, 339, 339, 45,
-        40, 286, 287, 281, 281, 281, 294, 281,
-        292, 281, 292, 281, 281, 281, 330, 330,
-        281, 40, 286, 287, 281, 281, 281, 294,
-        281, 292, 281, 292, 281, 281, 281, 330,
-        359, 281, 40, 286, 287, 281, 281, 281,
-        294, 281, 292, 281, 292, 281, 358, 281,
-        330, 330, 281, 40, 286, 287, 281, 281,
-        281, 294, 281, 292, 281, 76, 44, 44,
-        45, 40, 281, 281, 281, 281, 281, 76,
-        281, 292, 42, 281, 281, 58, 293, 281,
-        40, 286, 287, 281, 281, 281, 294, 281,
-        292, 281, 282, 283, 291, 285, 45, 40,
-        286, 287, 281, 281, 281, 288, 281, 281,
-        289, 281, 361, 191, 362, 362, 84, 79,
-        194, 195, 360, 360, 360, 197, 360, 360,
-        200, 360, 191, 362, 362, 84, 79, 194,
-        195, 360, 360, 360, 197, 360, 360, 200,
-        360, 363, 360, 360, 360, 98, 364, 360,
-        79, 194, 195, 360, 360, 360, 365, 360,
-        363, 360, 366, 367, 368, 369, 84, 79,
-        194, 195, 360, 360, 115, 370, 360, 360,
-        200, 360, 371, 367, 372, 372, 84, 79,
-        194, 195, 360, 360, 360, 370, 360, 360,
-        200, 360, 367, 372, 372, 84, 79, 194,
-        195, 360, 360, 360, 370, 360, 360, 200,
-        360, 373, 360, 360, 360, 98, 374, 360,
-        79, 194, 195, 360, 360, 360, 365, 360,
-        373, 360, 375, 376, 377, 378, 84, 79,
-        194, 195, 360, 360, 113, 379, 360, 360,
-        200, 360, 380, 376, 381, 381, 84, 79,
-        194, 195, 360, 360, 360, 379, 360, 360,
-        200, 360, 376, 381, 381, 84, 79, 194,
-        195, 360, 360, 360, 379, 360, 360, 200,
-        360, 382, 360, 360, 360, 98, 383, 360,
-        79, 194, 195, 360, 360, 360, 365, 360,
-        382, 360, 384, 385, 386, 387, 84, 79,
-        194, 195, 360, 360, 111, 388, 360, 360,
-        200, 360, 389, 385, 390, 390, 84, 79,
-        194, 195, 360, 360, 360, 388, 360, 360,
-        200, 360, 385, 390, 390, 84, 79, 194,
-        195, 360, 360, 360, 388, 360, 360, 200,
-        360, 391, 360, 360, 360, 98, 392, 360,
-        79, 194, 195, 360, 360, 360, 365, 360,
-        391, 360, 393, 394, 395, 396, 84, 79,
-        194, 195, 360, 360, 109, 397, 360, 360,
-        200, 360, 398, 394, 399, 399, 84, 79,
-        194, 195, 360, 360, 360, 397, 360, 360,
-        200, 360, 394, 399, 399, 84, 79, 194,
-        195, 360, 360, 360, 397, 360, 360, 200,
-        360, 98, 400, 360, 79, 194, 195, 360,
-        360, 360, 365, 360, 401, 401, 360, 79,
-        194, 195, 360, 360, 360, 365, 360, 402,
-        360, 360, 403, 194, 195, 360, 194, 195,
-        360, 404, 360, 194, 405, 360, 194, 406,
-        360, 194, 360, 402, 360, 360, 360, 194,
-        195, 360, 407, 360, 408, 409, 360, 79,
-        194, 195, 360, 360, 82, 360, 81, 360,
-        401, 401, 360, 79, 194, 195, 360, 401,
-        401, 360, 79, 194, 195, 360, 407, 360,
-        401, 401, 360, 79, 194, 195, 360, 407,
-        360, 408, 401, 360, 79, 194, 195, 360,
-        360, 82, 360, 98, 360, 410, 410, 84,
-        79, 194, 195, 360, 360, 360, 365, 360,
-        411, 107, 412, 413, 88, 79, 194, 195,
-        360, 360, 360, 365, 360, 107, 412, 413,
-        88, 79, 194, 195, 360, 360, 360, 365,
-        360, 412, 412, 88, 79, 194, 195, 360,
-        360, 360, 365, 360, 414, 104, 415, 416,
-        91, 79, 194, 195, 360, 360, 360, 365,
-        360, 104, 415, 416, 91, 79, 194, 195,
-        360, 360, 360, 365, 360, 415, 415, 91,
-        79, 194, 195, 360, 360, 360, 365, 360,
-        417, 101, 418, 419, 94, 79, 194, 195,
-        360, 360, 360, 365, 360, 101, 418, 419,
-        94, 79, 194, 195, 360, 360, 360, 365,
-        360, 418, 418, 94, 79, 194, 195, 360,
-        360, 360, 365, 360, 420, 98, 401, 421,
-        360, 79, 194, 195, 360, 360, 360, 365,
-        360, 98, 401, 421, 360, 79, 194, 195,
-        360, 360, 360, 365, 360, 401, 422, 360,
-        79, 194, 195, 360, 360, 360, 365, 360,
-        98, 360, 401, 401, 360, 79, 194, 195,
-        360, 360, 360, 365, 360, 80, 81, 360,
-        360, 98, 400, 360, 79, 194, 195, 360,
-        360, 360, 365, 360, 80, 360, 394, 399,
-        399, 84, 79, 194, 195, 360, 360, 360,
-        397, 360, 393, 394, 399, 399, 84, 79,
-        194, 195, 360, 360, 360, 397, 360, 360,
-        200, 360, 393, 394, 395, 399, 84, 79,
-        194, 195, 360, 360, 109, 397, 360, 360,
-        200, 360, 391, 360, 423, 360, 410, 410,
-        84, 79, 194, 195, 360, 360, 360, 365,
-        360, 391, 360, 391, 360, 360, 360, 401,
-        401, 360, 79, 194, 195, 360, 360, 360,
-        365, 360, 391, 360, 391, 360, 360, 360,
-        401, 424, 360, 79, 194, 195, 360, 360,
-        360, 365, 360, 391, 360, 391, 360, 423,
-        360, 401, 401, 360, 79, 194, 195, 360,
-        360, 360, 365, 360, 391, 360, 391, 81,
-        360, 360, 98, 392, 360, 79, 194, 195,
-        360, 360, 360, 365, 360, 391, 360, 384,
-        385, 390, 390, 84, 79, 194, 195, 360,
-        360, 360, 388, 360, 360, 200, 360, 384,
-        385, 386, 390, 84, 79, 194, 195, 360,
-        360, 111, 388, 360, 360, 200, 360, 382,
-        360, 425, 360, 410, 410, 84, 79, 194,
-        195, 360, 360, 360, 365, 360, 382, 360,
-        382, 360, 360, 360, 401, 401, 360, 79,
-        194, 195, 360, 360, 360, 365, 360, 382,
-        360, 382, 360, 360, 360, 401, 426, 360,
-        79, 194, 195, 360, 360, 360, 365, 360,
-        382, 360, 382, 360, 425, 360, 401, 401,
-        360, 79, 194, 195, 360, 360, 360, 365,
-        360, 382, 360, 382, 81, 360, 360, 98,
-        383, 360, 79, 194, 195, 360, 360, 360,
-        365, 360, 382, 360, 375, 376, 381, 381,
-        84, 79, 194, 195, 360, 360, 360, 379,
-        360, 360, 200, 360, 375, 376, 377, 381,
-        84, 79, 194, 195, 360, 360, 113, 379,
-        360, 360, 200, 360, 373, 360, 427, 360,
-        410, 410, 84, 79, 194, 195, 360, 360,
-        360, 365, 360, 373, 360, 373, 360, 360,
-        360, 401, 401, 360, 79, 194, 195, 360,
-        360, 360, 365, 360, 373, 360, 373, 360,
-        360, 360, 401, 428, 360, 79, 194, 195,
-        360, 360, 360, 365, 360, 373, 360, 373,
-        360, 427, 360, 401, 401, 360, 79, 194,
-        195, 360, 360, 360, 365, 360, 373, 360,
-        373, 81, 360, 360, 98, 374, 360, 79,
-        194, 195, 360, 360, 360, 365, 360, 373,
-        360, 366, 367, 372, 372, 84, 79, 194,
-        195, 360, 360, 360, 370, 360, 360, 200,
-        360, 366, 367, 368, 372, 84, 79, 194,
-        195, 360, 360, 115, 370, 360, 360, 200,
-        360, 363, 360, 429, 360, 410, 410, 84,
-        79, 194, 195, 360, 360, 360, 365, 360,
-        363, 360, 363, 360, 360, 360, 401, 401,
-        360, 79, 194, 195, 360, 360, 360, 365,
-        360, 363, 360, 363, 360, 360, 360, 401,
-        430, 360, 79, 194, 195, 360, 360, 360,
-        365, 360, 363, 360, 363, 360, 429, 360,
-        401, 401, 360, 79, 194, 195, 360, 360,
-        360, 365, 360, 363, 360, 363, 81, 360,
-        360, 98, 364, 360, 79, 194, 195, 360,
-        360, 360, 365, 360, 363, 360, 116, 83,
-        83, 84, 79, 431, 431, 431, 431, 156,
-        116, 431, 190, 191, 362, 362, 84, 79,
-        194, 195, 360, 360, 360, 197, 360, 360,
-        200, 360, 116, 83, 83, 84, 79, 431,
-        431, 431, 431, 431, 116, 431, 433, 434,
-        435, 436, 123, 118, 437, 438, 432, 432,
-        155, 439, 432, 432, 440, 432, 441, 434,
-        436, 436, 123, 118, 437, 438, 432, 432,
-        432, 439, 432, 432, 440, 432, 434, 436,
-        436, 123, 118, 437, 438, 432, 432, 432,
-        439, 432, 432, 440, 432, 442, 432, 432,
-        432, 136, 443, 432, 118, 437, 438, 432,
-        432, 432, 444, 432, 442, 432, 445, 446,
-        447, 448, 123, 118, 437, 438, 432, 432,
-        153, 449, 432, 432, 440, 432, 450, 446,
-        451, 451, 123, 118, 437, 438, 432, 432,
-        432, 449, 432, 432, 440, 432, 446, 451,
-        451, 123, 118, 437, 438, 432, 432, 432,
-        449, 432, 432, 440, 432, 452, 432, 432,
-        432, 136, 453, 432, 118, 437, 438, 432,
-        432, 432, 444, 432, 452, 432, 454, 455,
-        456, 457, 123, 118, 437, 438, 432, 432,
-        151, 458, 432, 432, 440, 432, 459, 455,
-        460, 460, 123, 118, 437, 438, 432, 432,
-        432, 458, 432, 432, 440, 432, 455, 460,
-        460, 123, 118, 437, 438, 432, 432, 432,
-        458, 432, 432, 440, 432, 461, 432, 432,
-        432, 136, 462, 432, 118, 437, 438, 432,
-        432, 432, 444, 432, 461, 432, 463, 464,
-        465, 466, 123, 118, 437, 438, 432, 432,
-        149, 467, 432, 432, 440, 432, 468, 464,
-        469, 469, 123, 118, 437, 438, 432, 432,
-        432, 467, 432, 432, 440, 432, 464, 469,
-        469, 123, 118, 437, 438, 432, 432, 432,
-        467, 432, 432, 440, 432, 470, 432, 432,
-        432, 136, 471, 432, 118, 437, 438, 432,
-        432, 432, 444, 432, 470, 432, 472, 473,
-        474, 475, 123, 118, 437, 438, 432, 432,
-        147, 476, 432, 432, 440, 432, 477, 473,
-        478, 478, 123, 118, 437, 438, 432, 432,
-        432, 476, 432, 432, 440, 432, 473, 478,
-        478, 123, 118, 437, 438, 432, 432, 432,
-        476, 432, 432, 440, 432, 136, 479, 432,
-        118, 437, 438, 432, 432, 432, 444, 432,
-        480, 480, 432, 118, 437, 438, 432, 432,
-        432, 444, 432, 481, 432, 432, 482, 437,
-        438, 432, 437, 438, 432, 483, 432, 437,
-        484, 432, 437, 485, 432, 437, 432, 481,
-        432, 432, 432, 437, 438, 432, 486, 432,
-        487, 488, 432, 118, 437, 438, 432, 432,
-        121, 432, 120, 432, 480, 480, 432, 118,
-        437, 438, 432, 480, 480, 432, 118, 437,
-        438, 432, 486, 432, 480, 480, 432, 118,
-        437, 438, 432, 486, 432, 487, 480, 432,
-        118, 437, 438, 432, 432, 121, 432, 136,
-        432, 489, 489, 123, 118, 437, 438, 432,
-        432, 432, 444, 432, 490, 145, 491, 492,
-        126, 118, 437, 438, 432, 432, 432, 444,
-        432, 145, 491, 492, 126, 118, 437, 438,
-        432, 432, 432, 444, 432, 491, 491, 126,
-        118, 437, 438, 432, 432, 432, 444, 432,
-        493, 142, 494, 495, 129, 118, 437, 438,
-        432, 432, 432, 444, 432, 142, 494, 495,
-        129, 118, 437, 438, 432, 432, 432, 444,
-        432, 494, 494, 129, 118, 437, 438, 432,
-        432, 432, 444, 432, 496, 139, 497, 498,
-        132, 118, 437, 438, 432, 432, 432, 444,
-        432, 139, 497, 498, 132, 118, 437, 438,
-        432, 432, 432, 444, 432, 497, 497, 132,
-        118, 437, 438, 432, 432, 432, 444, 432,
-        499, 136, 480, 500, 432, 118, 437, 438,
-        432, 432, 432, 444, 432, 136, 480, 500,
-        432, 118, 437, 438, 432, 432, 432, 444,
-        432, 480, 501, 432, 118, 437, 438, 432,
-        432, 432, 444, 432, 136, 432, 480, 480,
-        432, 118, 437, 438, 432, 432, 432, 444,
-        432, 119, 120, 432, 432, 136, 479, 432,
-        118, 437, 438, 432, 432, 432, 444, 432,
-        119, 432, 473, 478, 478, 123, 118, 437,
-        438, 432, 432, 432, 476, 432, 472, 473,
-        478, 478, 123, 118, 437, 438, 432, 432,
-        432, 476, 432, 432, 440, 432, 472, 473,
-        474, 478, 123, 118, 437, 438, 432, 432,
-        147, 476, 432, 432, 440, 432, 470, 432,
-        502, 432, 489, 489, 123, 118, 437, 438,
-        432, 432, 432, 444, 432, 470, 432, 470,
-        432, 432, 432, 480, 480, 432, 118, 437,
-        438, 432, 432, 432, 444, 432, 470, 432,
-        470, 432, 432, 432, 480, 503, 432, 118,
-        437, 438, 432, 432, 432, 444, 432, 470,
-        432, 470, 432, 502, 432, 480, 480, 432,
-        118, 437, 438, 432, 432, 432, 444, 432,
-        470, 432, 470, 120, 432, 432, 136, 471,
-        432, 118, 437, 438, 432, 432, 432, 444,
-        432, 470, 432, 463, 464, 469, 469, 123,
-        118, 437, 438, 432, 432, 432, 467, 432,
-        432, 440, 432, 463, 464, 465, 469, 123,
-        118, 437, 438, 432, 432, 149, 467, 432,
-        432, 440, 432, 461, 432, 504, 432, 489,
-        489, 123, 118, 437, 438, 432, 432, 432,
-        444, 432, 461, 432, 461, 432, 432, 432,
-        480, 480, 432, 118, 437, 438, 432, 432,
-        432, 444, 432, 461, 432, 461, 432, 432,
-        432, 480, 505, 432, 118, 437, 438, 432,
-        432, 432, 444, 432, 461, 432, 461, 432,
-        504, 432, 480, 480, 432, 118, 437, 438,
-        432, 432, 432, 444, 432, 461, 432, 461,
-        120, 432, 432, 136, 462, 432, 118, 437,
-        438, 432, 432, 432, 444, 432, 461, 432,
-        454, 455, 460, 460, 123, 118, 437, 438,
-        432, 432, 432, 458, 432, 432, 440, 432,
-        454, 455, 456, 460, 123, 118, 437, 438,
-        432, 432, 151, 458, 432, 432, 440, 432,
-        452, 432, 506, 432, 489, 489, 123, 118,
-        437, 438, 432, 432, 432, 444, 432, 452,
-        432, 452, 432, 432, 432, 480, 480, 432,
-        118, 437, 438, 432, 432, 432, 444, 432,
-        452, 432, 452, 432, 432, 432, 480, 507,
-        432, 118, 437, 438, 432, 432, 432, 444,
-        432, 452, 432, 452, 432, 506, 432, 480,
-        480, 432, 118, 437, 438, 432, 432, 432,
-        444, 432, 452, 432, 452, 120, 432, 432,
-        136, 453, 432, 118, 437, 438, 432, 432,
-        432, 444, 432, 452, 432, 445, 446, 451,
-        451, 123, 118, 437, 438, 432, 432, 432,
-        449, 432, 432, 440, 432, 445, 446, 447,
-        451, 123, 118, 437, 438, 432, 432, 153,
-        449, 432, 432, 440, 432, 442, 432, 508,
-        432, 489, 489, 123, 118, 437, 438, 432,
-        432, 432, 444, 432, 442, 432, 442, 432,
-        432, 432, 480, 480, 432, 118, 437, 438,
-        432, 432, 432, 444, 432, 442, 432, 442,
-        432, 432, 432, 480, 509, 432, 118, 437,
-        438, 432, 432, 432, 444, 432, 442, 432,
-        442, 432, 508, 432, 480, 480, 432, 118,
-        437, 438, 432, 432, 432, 444, 432, 442,
-        432, 442, 120, 432, 432, 136, 443, 432,
-        118, 437, 438, 432, 432, 432, 444, 432,
-        442, 432, 433, 434, 436, 436, 123, 118,
-        437, 438, 432, 432, 432, 439, 432, 432,
-        440, 432, 188, 189, 190, 191, 510, 362,
-        84, 79, 194, 195, 196, 196, 156, 197,
-        360, 188, 200, 360, 203, 511, 205, 206,
-        6, 1, 207, 208, 202, 202, 38, 209,
-        202, 202, 210, 202, 213, 189, 190, 191,
-        512, 513, 84, 157, 514, 515, 202, 196,
-        156, 516, 202, 213, 200, 202, 116, 517,
-        517, 84, 157, 207, 208, 202, 202, 156,
-        518, 202, 519, 202, 202, 520, 514, 515,
-        202, 514, 515, 202, 254, 202, 514, 521,
-        202, 514, 522, 202, 514, 202, 519, 202,
-        202, 202, 514, 515, 202, 523, 3, 360,
-        360, 401, 430, 360, 79, 194, 195, 360,
-        360, 360, 365, 360, 523, 360, 524, 367,
-        525, 526, 84, 157, 514, 515, 202, 202,
-        158, 370, 202, 202, 200, 202, 527, 367,
-        528, 528, 84, 157, 514, 515, 202, 202,
-        202, 370, 202, 202, 200, 202, 367, 528,
-        528, 84, 157, 514, 515, 202, 202, 202,
-        370, 202, 202, 200, 202, 524, 367, 528,
-        528, 84, 157, 514, 515, 202, 202, 202,
-        370, 202, 202, 200, 202, 524, 367, 525,
-        528, 84, 157, 514, 515, 202, 202, 158,
-        370, 202, 202, 200, 202, 213, 202, 279,
-        116, 529, 529, 160, 157, 207, 208, 202,
-        202, 202, 518, 202, 213, 202, 530, 184,
-        531, 532, 162, 157, 514, 515, 202, 202,
-        202, 533, 202, 184, 531, 532, 162, 157,
-        514, 515, 202, 202, 202, 533, 202, 531,
-        531, 162, 157, 514, 515, 202, 202, 202,
-        533, 202, 534, 181, 535, 536, 165, 157,
-        514, 515, 202, 202, 202, 533, 202, 181,
-        535, 536, 165, 157, 514, 515, 202, 202,
-        202, 533, 202, 535, 535, 165, 157, 514,
-        515, 202, 202, 202, 533, 202, 537, 178,
-        538, 539, 168, 157, 514, 515, 202, 202,
-        202, 533, 202, 178, 538, 539, 168, 157,
-        514, 515, 202, 202, 202, 533, 202, 538,
-        538, 168, 157, 514, 515, 202, 202, 202,
-        533, 202, 540, 175, 541, 542, 202, 157,
-        514, 515, 202, 202, 202, 533, 202, 175,
-        541, 542, 202, 157, 514, 515, 202, 202,
-        202, 533, 202, 541, 541, 202, 157, 514,
-        515, 202, 202, 202, 533, 202, 543, 202,
-        544, 545, 202, 157, 514, 515, 202, 202,
-        172, 202, 171, 202, 541, 541, 202, 157,
-        514, 515, 202, 541, 541, 202, 157, 514,
-        515, 202, 543, 202, 541, 541, 202, 157,
-        514, 515, 202, 543, 202, 544, 541, 202,
-        157, 514, 515, 202, 202, 172, 202, 523,
-        171, 360, 360, 98, 364, 360, 79, 194,
-        195, 360, 360, 360, 365, 360, 523, 360,
-        547, 546, 548, 548, 546, 186, 549, 550,
-        546, 548, 548, 546, 186, 549, 550, 546,
-        551, 546, 546, 552, 549, 550, 546, 549,
-        550, 546, 553, 546, 549, 554, 546, 549,
-        555, 546, 549, 546, 551, 546, 546, 546,
+        1, 0, 2, 3, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 2, 0, 1, 0, 0, 0, 0, 
+        4, 0, 5, 5, 6, 1, 0, 7, 
+        7, 6, 0, 6, 0, 8, 8, 9, 
+        1, 0, 10, 10, 9, 0, 9, 0, 
+        11, 11, 12, 1, 0, 13, 13, 12, 
+        0, 12, 0, 14, 14, 15, 1, 0, 
+        16, 16, 15, 0, 15, 0, 17, 0, 
+        0, 0, 1, 0, 18, 0, 19, 0, 
+        20, 14, 14, 15, 1, 0, 21, 0, 
+        22, 0, 23, 11, 11, 12, 1, 0, 
+        24, 0, 25, 0, 26, 8, 8, 9, 
+        1, 0, 27, 0, 28, 0, 29, 5, 
+        5, 6, 1, 0, 0, 0, 0, 0, 
+        29, 0, 29, 5, 5, 6, 1, 0, 
+        0, 0, 0, 30, 29, 0, 31, 5, 
+        5, 6, 1, 0, 0, 0, 0, 0, 
+        31, 0, 31, 5, 5, 6, 1, 0, 
+        0, 0, 0, 32, 31, 0, 33, 5, 
+        5, 6, 1, 0, 0, 0, 0, 0, 
+        33, 0, 33, 5, 5, 6, 1, 0, 
+        0, 0, 0, 34, 33, 0, 35, 5, 
+        5, 6, 1, 0, 0, 0, 0, 0, 
+        35, 0, 35, 5, 5, 6, 1, 0, 
+        0, 0, 0, 36, 35, 0, 37, 5, 
+        5, 6, 1, 0, 0, 0, 0, 0, 
+        37, 0, 37, 5, 5, 6, 1, 0, 
+        0, 0, 0, 38, 37, 0, 40, 39, 
+        41, 42, 39, 39, 39, 39, 39, 39, 
+        39, 39, 39, 39, 39, 39, 39, 41, 
+        39, 40, 39, 39, 39, 39, 43, 39, 
+        44, 44, 45, 40, 39, 46, 46, 45, 
+        39, 45, 39, 47, 47, 48, 40, 39, 
+        49, 49, 48, 39, 48, 39, 50, 50, 
+        51, 40, 39, 52, 52, 51, 39, 51, 
+        39, 53, 53, 54, 40, 39, 55, 55, 
+        54, 39, 54, 39, 56, 39, 39, 39, 
+        40, 39, 57, 39, 58, 39, 59, 53, 
+        53, 54, 40, 39, 60, 39, 61, 39, 
+        62, 50, 50, 51, 40, 39, 63, 39, 
+        64, 39, 65, 47, 47, 48, 40, 39, 
+        66, 39, 67, 39, 68, 44, 44, 45, 
+        40, 39, 39, 39, 39, 39, 68, 39, 
+        68, 44, 44, 45, 40, 39, 39, 39, 
+        39, 69, 68, 39, 70, 44, 44, 45, 
+        40, 39, 39, 39, 39, 39, 70, 39, 
+        70, 44, 44, 45, 40, 39, 39, 39, 
+        39, 71, 70, 39, 72, 44, 44, 45, 
+        40, 39, 39, 39, 39, 39, 72, 39, 
+        72, 44, 44, 45, 40, 39, 39, 39, 
+        39, 73, 72, 39, 74, 44, 44, 45, 
+        40, 39, 39, 39, 39, 39, 74, 39, 
+        74, 44, 44, 45, 40, 39, 39, 39, 
+        39, 75, 74, 39, 76, 44, 44, 45, 
+        40, 39, 39, 39, 39, 39, 76, 39, 
+        76, 44, 44, 45, 40, 39, 39, 39, 
+        39, 77, 76, 39, 79, 78, 80, 81, 
+        78, 78, 78, 78, 78, 78, 78, 78, 
+        78, 78, 78, 78, 78, 80, 78, 79, 
+        78, 78, 78, 78, 82, 78, 83, 83, 
+        84, 79, 78, 86, 86, 84, 85, 84, 
+        85, 87, 87, 88, 79, 78, 89, 89, 
+        88, 78, 88, 78, 90, 90, 91, 79, 
+        78, 92, 92, 91, 78, 91, 78, 93, 
+        93, 94, 79, 78, 95, 95, 94, 78, 
+        94, 78, 96, 78, 78, 78, 79, 78, 
+        97, 78, 98, 78, 99, 93, 93, 94, 
+        79, 78, 100, 78, 101, 78, 102, 90, 
+        90, 91, 79, 78, 103, 78, 104, 78, 
+        105, 87, 87, 88, 79, 78, 106, 78, 
+        107, 78, 108, 83, 83, 84, 79, 78, 
+        78, 78, 78, 78, 108, 78, 108, 83, 
+        83, 84, 79, 78, 78, 78, 78, 109, 
+        108, 78, 110, 83, 83, 84, 79, 78, 
+        78, 78, 78, 78, 110, 78, 110, 83, 
+        83, 84, 79, 78, 78, 78, 78, 111, 
+        110, 78, 112, 83, 83, 84, 79, 78, 
+        78, 78, 78, 78, 112, 78, 112, 83, 
+        83, 84, 79, 78, 78, 78, 78, 113, 
+        112, 78, 114, 83, 83, 84, 79, 78, 
+        78, 78, 78, 78, 114, 78, 114, 83, 
+        83, 84, 79, 78, 78, 78, 78, 115, 
+        114, 78, 116, 83, 83, 84, 79, 78, 
+        78, 78, 78, 78, 116, 78, 118, 117, 
+        119, 120, 117, 117, 117, 117, 117, 117, 
+        117, 117, 117, 117, 117, 117, 117, 119, 
+        117, 118, 117, 117, 117, 117, 121, 117, 
+        122, 122, 123, 118, 117, 124, 124, 123, 
+        117, 123, 117, 125, 125, 126, 118, 117, 
+        127, 127, 126, 117, 126, 117, 128, 128, 
+        129, 118, 117, 130, 130, 129, 117, 129, 
+        117, 131, 131, 132, 118, 117, 133, 133, 
+        132, 117, 132, 117, 134, 117, 117, 117, 
+        118, 117, 135, 117, 136, 117, 137, 131, 
+        131, 132, 118, 117, 138, 117, 139, 117, 
+        140, 128, 128, 129, 118, 117, 141, 117, 
+        142, 117, 143, 125, 125, 126, 118, 117, 
+        144, 117, 145, 117, 146, 122, 122, 123, 
+        118, 117, 117, 117, 117, 117, 146, 117, 
+        146, 122, 122, 123, 118, 117, 117, 117, 
+        117, 147, 146, 117, 148, 122, 122, 123, 
+        118, 117, 117, 117, 117, 117, 148, 117, 
+        148, 122, 122, 123, 118, 117, 117, 117, 
+        117, 149, 148, 117, 150, 122, 122, 123, 
+        118, 117, 117, 117, 117, 117, 150, 117, 
+        150, 122, 122, 123, 118, 117, 117, 117, 
+        117, 151, 150, 117, 152, 122, 122, 123, 
+        118, 117, 117, 117, 117, 117, 152, 117, 
+        152, 122, 122, 123, 118, 117, 117, 117, 
+        117, 153, 152, 117, 154, 122, 122, 123, 
+        118, 117, 117, 117, 117, 117, 154, 117, 
+        154, 122, 122, 123, 118, 117, 117, 117, 
+        117, 155, 154, 117, 116, 83, 83, 84, 
+        79, 78, 78, 78, 78, 156, 116, 78, 
+        86, 86, 84, 1, 0, 114, 83, 83, 
+        84, 157, 0, 0, 0, 0, 0, 114, 
+        0, 114, 83, 83, 84, 157, 0, 0, 
+        0, 0, 158, 114, 0, 159, 159, 160, 
+        1, 0, 7, 7, 160, 0, 161, 161, 
+        162, 157, 0, 163, 163, 162, 0, 162, 
+        0, 164, 164, 165, 157, 0, 166, 166, 
+        165, 0, 165, 0, 167, 167, 168, 157, 
+        0, 169, 169, 168, 0, 168, 0, 157, 
+        0, 170, 171, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        170, 0, 157, 0, 0, 0, 0, 172, 
+        0, 173, 0, 0, 0, 157, 0, 174, 
+        0, 175, 0, 176, 167, 167, 168, 157, 
+        0, 177, 0, 178, 0, 179, 164, 164, 
+        165, 157, 0, 180, 0, 181, 0, 182, 
+        161, 161, 162, 157, 0, 183, 0, 184, 
+        0, 186, 185, 188, 189, 190, 191, 192, 
+        193, 84, 79, 194, 195, 196, 196, 156, 
+        197, 198, 199, 200, 201, 187, 203, 204, 
+        205, 206, 6, 1, 207, 208, 202, 202, 
+        38, 209, 202, 202, 210, 202, 211, 204, 
+        212, 212, 6, 1, 207, 208, 202, 202, 
+        202, 209, 202, 202, 210, 202, 204, 212, 
+        212, 6, 1, 207, 208, 202, 202, 202, 
+        209, 202, 202, 210, 202, 213, 202, 202, 
+        202, 19, 214, 202, 1, 207, 208, 202, 
+        202, 202, 215, 202, 213, 202, 216, 217, 
+        218, 219, 6, 1, 207, 208, 202, 202, 
+        36, 220, 202, 202, 210, 202, 221, 217, 
+        222, 222, 6, 1, 207, 208, 202, 202, 
+        202, 220, 202, 202, 210, 202, 217, 222, 
+        222, 6, 1, 207, 208, 202, 202, 202, 
+        220, 202, 202, 210, 202, 223, 202, 202, 
+        202, 19, 224, 202, 1, 207, 208, 202, 
+        202, 202, 215, 202, 223, 202, 225, 226, 
+        227, 228, 6, 1, 207, 208, 202, 202, 
+        34, 229, 202, 202, 210, 202, 230, 226, 
+        231, 231, 6, 1, 207, 208, 202, 202, 
+        202, 229, 202, 202, 210, 202, 226, 231, 
+        231, 6, 1, 207, 208, 202, 202, 202, 
+        229, 202, 202, 210, 202, 232, 202, 202, 
+        202, 19, 233, 202, 1, 207, 208, 202, 
+        202, 202, 215, 202, 232, 202, 234, 235, 
+        236, 237, 6, 1, 207, 208, 202, 202, 
+        32, 238, 202, 202, 210, 202, 239, 235, 
+        240, 240, 6, 1, 207, 208, 202, 202, 
+        202, 238, 202, 202, 210, 202, 235, 240, 
+        240, 6, 1, 207, 208, 202, 202, 202, 
+        238, 202, 202, 210, 202, 241, 202, 202, 
+        202, 19, 242, 202, 1, 207, 208, 202, 
+        202, 202, 215, 202, 241, 202, 243, 244, 
+        245, 246, 6, 1, 207, 208, 202, 202, 
+        30, 247, 202, 202, 210, 202, 248, 244, 
+        249, 249, 6, 1, 207, 208, 202, 202, 
+        202, 247, 202, 202, 210, 202, 244, 249, 
+        249, 6, 1, 207, 208, 202, 202, 202, 
+        247, 202, 202, 210, 202, 19, 250, 202, 
+        1, 207, 208, 202, 202, 202, 215, 202, 
+        251, 251, 202, 1, 207, 208, 202, 202, 
+        202, 215, 202, 252, 202, 202, 253, 207, 
+        208, 202, 207, 208, 202, 254, 202, 207, 
+        255, 202, 207, 256, 202, 207, 202, 252, 
+        202, 202, 202, 207, 208, 202, 257, 202, 
+        258, 259, 202, 1, 207, 208, 202, 202, 
+        4, 202, 3, 202, 251, 251, 202, 1, 
+        207, 208, 202, 251, 251, 202, 1, 207, 
+        208, 202, 257, 202, 251, 251, 202, 1, 
+        207, 208, 202, 257, 202, 258, 251, 202, 
+        1, 207, 208, 202, 202, 4, 202, 19, 
+        202, 260, 260, 6, 1, 207, 208, 202, 
+        202, 202, 215, 202, 261, 28, 262, 263, 
+        9, 1, 207, 208, 202, 202, 202, 215, 
+        202, 28, 262, 263, 9, 1, 207, 208, 
+        202, 202, 202, 215, 202, 262, 262, 9, 
+        1, 207, 208, 202, 202, 202, 215, 202, 
+        264, 25, 265, 266, 12, 1, 207, 208, 
+        202, 202, 202, 215, 202, 25, 265, 266, 
+        12, 1, 207, 208, 202, 202, 202, 215, 
+        202, 265, 265, 12, 1, 207, 208, 202, 
+        202, 202, 215, 202, 267, 22, 268, 269, 
+        15, 1, 207, 208, 202, 202, 202, 215, 
+        202, 22, 268, 269, 15, 1, 207, 208, 
+        202, 202, 202, 215, 202, 268, 268, 15, 
+        1, 207, 208, 202, 202, 202, 215, 202, 
+        270, 19, 251, 271, 202, 1, 207, 208, 
+        202, 202, 202, 215, 202, 19, 251, 271, 
+        202, 1, 207, 208, 202, 202, 202, 215, 
+        202, 251, 272, 202, 1, 207, 208, 202, 
+        202, 202, 215, 202, 19, 202, 251, 251, 
+        202, 1, 207, 208, 202, 202, 202, 215, 
+        202, 2, 3, 202, 202, 19, 250, 202, 
+        1, 207, 208, 202, 202, 202, 215, 202, 
+        2, 202, 244, 249, 249, 6, 1, 207, 
+        208, 202, 202, 202, 247, 202, 243, 244, 
+        249, 249, 6, 1, 207, 208, 202, 202, 
+        202, 247, 202, 202, 210, 202, 243, 244, 
+        245, 249, 6, 1, 207, 208, 202, 202, 
+        30, 247, 202, 202, 210, 202, 241, 202, 
+        273, 202, 260, 260, 6, 1, 207, 208, 
+        202, 202, 202, 215, 202, 241, 202, 241, 
+        202, 202, 202, 251, 251, 202, 1, 207, 
+        208, 202, 202, 202, 215, 202, 241, 202, 
+        241, 202, 202, 202, 251, 274, 202, 1, 
+        207, 208, 202, 202, 202, 215, 202, 241, 
+        202, 241, 202, 273, 202, 251, 251, 202, 
+        1, 207, 208, 202, 202, 202, 215, 202, 
+        241, 202, 241, 3, 202, 202, 19, 242, 
+        202, 1, 207, 208, 202, 202, 202, 215, 
+        202, 241, 202, 234, 235, 240, 240, 6, 
+        1, 207, 208, 202, 202, 202, 238, 202, 
+        202, 210, 202, 234, 235, 236, 240, 6, 
+        1, 207, 208, 202, 202, 32, 238, 202, 
+        202, 210, 202, 232, 202, 275, 202, 260, 
+        260, 6, 1, 207, 208, 202, 202, 202, 
+        215, 202, 232, 202, 232, 202, 202, 202, 
+        251, 251, 202, 1, 207, 208, 202, 202, 
+        202, 215, 202, 232, 202, 232, 202, 202, 
+        202, 251, 276, 202, 1, 207, 208, 202, 
+        202, 202, 215, 202, 232, 202, 232, 202, 
+        275, 202, 251, 251, 202, 1, 207, 208, 
+        202, 202, 202, 215, 202, 232, 202, 232, 
+        3, 202, 202, 19, 233, 202, 1, 207, 
+        208, 202, 202, 202, 215, 202, 232, 202, 
+        225, 226, 231, 231, 6, 1, 207, 208, 
+        202, 202, 202, 229, 202, 202, 210, 202, 
+        225, 226, 227, 231, 6, 1, 207, 208, 
+        202, 202, 34, 229, 202, 202, 210, 202, 
+        223, 202, 277, 202, 260, 260, 6, 1, 
+        207, 208, 202, 202, 202, 215, 202, 223, 
+        202, 223, 202, 202, 202, 251, 251, 202, 
+        1, 207, 208, 202, 202, 202, 215, 202, 
+        223, 202, 223, 202, 202, 202, 251, 278, 
+        202, 1, 207, 208, 202, 202, 202, 215, 
+        202, 223, 202, 223, 202, 277, 202, 251, 
+        251, 202, 1, 207, 208, 202, 202, 202, 
+        215, 202, 223, 202, 223, 3, 202, 202, 
+        19, 224, 202, 1, 207, 208, 202, 202, 
+        202, 215, 202, 223, 202, 216, 217, 222, 
+        222, 6, 1, 207, 208, 202, 202, 202, 
+        220, 202, 202, 210, 202, 216, 217, 218, 
+        222, 6, 1, 207, 208, 202, 202, 36, 
+        220, 202, 202, 210, 202, 213, 202, 279, 
+        202, 260, 260, 6, 1, 207, 208, 202, 
+        202, 202, 215, 202, 213, 202, 213, 202, 
+        202, 202, 251, 251, 202, 1, 207, 208, 
+        202, 202, 202, 215, 202, 213, 202, 213, 
+        202, 202, 202, 251, 280, 202, 1, 207, 
+        208, 202, 202, 202, 215, 202, 213, 202, 
+        213, 202, 279, 202, 251, 251, 202, 1, 
+        207, 208, 202, 202, 202, 215, 202, 213, 
+        202, 213, 3, 202, 202, 19, 214, 202, 
+        1, 207, 208, 202, 202, 202, 215, 202, 
+        213, 202, 203, 204, 212, 212, 6, 1, 
+        207, 208, 202, 202, 202, 209, 202, 202, 
+        210, 202, 203, 204, 205, 212, 6, 1, 
+        207, 208, 202, 202, 38, 209, 202, 202, 
+        210, 202, 282, 283, 284, 285, 45, 40, 
+        286, 287, 281, 281, 77, 288, 281, 281, 
+        289, 281, 290, 283, 291, 285, 45, 40, 
+        286, 287, 281, 281, 281, 288, 281, 281, 
+        289, 281, 283, 291, 285, 45, 40, 286, 
+        287, 281, 281, 281, 288, 281, 281, 289, 
+        281, 292, 281, 281, 281, 58, 293, 281, 
+        40, 286, 287, 281, 281, 281, 294, 281, 
+        292, 281, 295, 296, 297, 298, 45, 40, 
+        286, 287, 281, 281, 75, 299, 281, 281, 
+        289, 281, 300, 296, 301, 301, 45, 40, 
+        286, 287, 281, 281, 281, 299, 281, 281, 
+        289, 281, 296, 301, 301, 45, 40, 286, 
+        287, 281, 281, 281, 299, 281, 281, 289, 
+        281, 302, 281, 281, 281, 58, 303, 281, 
+        40, 286, 287, 281, 281, 281, 294, 281, 
+        302, 281, 304, 305, 306, 307, 45, 40, 
+        286, 287, 281, 281, 73, 308, 281, 281, 
+        289, 281, 309, 305, 310, 310, 45, 40, 
+        286, 287, 281, 281, 281, 308, 281, 281, 
+        289, 281, 305, 310, 310, 45, 40, 286, 
+        287, 281, 281, 281, 308, 281, 281, 289, 
+        281, 311, 281, 281, 281, 58, 312, 281, 
+        40, 286, 287, 281, 281, 281, 294, 281, 
+        311, 281, 313, 314, 315, 316, 45, 40, 
+        286, 287, 281, 281, 71, 317, 281, 281, 
+        289, 281, 318, 314, 319, 319, 45, 40, 
+        286, 287, 281, 281, 281, 317, 281, 281, 
+        289, 281, 314, 319, 319, 45, 40, 286, 
+        287, 281, 281, 281, 317, 281, 281, 289, 
+        281, 320, 281, 281, 281, 58, 321, 281, 
+        40, 286, 287, 281, 281, 281, 294, 281, 
+        320, 281, 322, 323, 324, 325, 45, 40, 
+        286, 287, 281, 281, 69, 326, 281, 281, 
+        289, 281, 327, 323, 328, 328, 45, 40, 
+        286, 287, 281, 281, 281, 326, 281, 281, 
+        289, 281, 323, 328, 328, 45, 40, 286, 
+        287, 281, 281, 281, 326, 281, 281, 289, 
+        281, 58, 329, 281, 40, 286, 287, 281, 
+        281, 281, 294, 281, 330, 330, 281, 40, 
+        286, 287, 281, 281, 281, 294, 281, 331, 
+        281, 281, 332, 286, 287, 281, 286, 287, 
+        281, 333, 281, 286, 334, 281, 286, 335, 
+        281, 286, 281, 331, 281, 281, 281, 286, 
+        287, 281, 336, 281, 337, 338, 281, 40, 
+        286, 287, 281, 281, 43, 281, 42, 281, 
+        330, 330, 281, 40, 286, 287, 281, 330, 
+        330, 281, 40, 286, 287, 281, 336, 281, 
+        330, 330, 281, 40, 286, 287, 281, 336, 
+        281, 337, 330, 281, 40, 286, 287, 281, 
+        281, 43, 281, 58, 281, 339, 339, 45, 
+        40, 286, 287, 281, 281, 281, 294, 281, 
+        340, 67, 341, 342, 48, 40, 286, 287, 
+        281, 281, 281, 294, 281, 67, 341, 342, 
+        48, 40, 286, 287, 281, 281, 281, 294, 
+        281, 341, 341, 48, 40, 286, 287, 281, 
+        281, 281, 294, 281, 343, 64, 344, 345, 
+        51, 40, 286, 287, 281, 281, 281, 294, 
+        281, 64, 344, 345, 51, 40, 286, 287, 
+        281, 281, 281, 294, 281, 344, 344, 51, 
+        40, 286, 287, 281, 281, 281, 294, 281, 
+        346, 61, 347, 348, 54, 40, 286, 287, 
+        281, 281, 281, 294, 281, 61, 347, 348, 
+        54, 40, 286, 287, 281, 281, 281, 294, 
+        281, 347, 347, 54, 40, 286, 287, 281, 
+        281, 281, 294, 281, 349, 58, 330, 350, 
+        281, 40, 286, 287, 281, 281, 281, 294, 
+        281, 58, 330, 350, 281, 40, 286, 287, 
+        281, 281, 281, 294, 281, 330, 351, 281, 
+        40, 286, 287, 281, 281, 281, 294, 281, 
+        58, 281, 330, 330, 281, 40, 286, 287, 
+        281, 281, 281, 294, 281, 41, 42, 281, 
+        281, 58, 329, 281, 40, 286, 287, 281, 
+        281, 281, 294, 281, 41, 281, 323, 328, 
+        328, 45, 40, 286, 287, 281, 281, 281, 
+        326, 281, 322, 323, 328, 328, 45, 40, 
+        286, 287, 281, 281, 281, 326, 281, 281, 
+        289, 281, 322, 323, 324, 328, 45, 40, 
+        286, 287, 281, 281, 69, 326, 281, 281, 
+        289, 281, 320, 281, 352, 281, 339, 339, 
+        45, 40, 286, 287, 281, 281, 281, 294, 
+        281, 320, 281, 320, 281, 281, 281, 330, 
+        330, 281, 40, 286, 287, 281, 281, 281, 
+        294, 281, 320, 281, 320, 281, 281, 281, 
+        330, 353, 281, 40, 286, 287, 281, 281, 
+        281, 294, 281, 320, 281, 320, 281, 352, 
+        281, 330, 330, 281, 40, 286, 287, 281, 
+        281, 281, 294, 281, 320, 281, 320, 42, 
+        281, 281, 58, 321, 281, 40, 286, 287, 
+        281, 281, 281, 294, 281, 320, 281, 313, 
+        314, 319, 319, 45, 40, 286, 287, 281, 
+        281, 281, 317, 281, 281, 289, 281, 313, 
+        314, 315, 319, 45, 40, 286, 287, 281, 
+        281, 71, 317, 281, 281, 289, 281, 311, 
+        281, 354, 281, 339, 339, 45, 40, 286, 
+        287, 281, 281, 281, 294, 281, 311, 281, 
+        311, 281, 281, 281, 330, 330, 281, 40, 
+        286, 287, 281, 281, 281, 294, 281, 311, 
+        281, 311, 281, 281, 281, 330, 355, 281, 
+        40, 286, 287, 281, 281, 281, 294, 281, 
+        311, 281, 311, 281, 354, 281, 330, 330, 
+        281, 40, 286, 287, 281, 281, 281, 294, 
+        281, 311, 281, 311, 42, 281, 281, 58, 
+        312, 281, 40, 286, 287, 281, 281, 281, 
+        294, 281, 311, 281, 304, 305, 310, 310, 
+        45, 40, 286, 287, 281, 281, 281, 308, 
+        281, 281, 289, 281, 304, 305, 306, 310, 
+        45, 40, 286, 287, 281, 281, 73, 308, 
+        281, 281, 289, 281, 302, 281, 356, 281, 
+        339, 339, 45, 40, 286, 287, 281, 281, 
+        281, 294, 281, 302, 281, 302, 281, 281, 
+        281, 330, 330, 281, 40, 286, 287, 281, 
+        281, 281, 294, 281, 302, 281, 302, 281, 
+        281, 281, 330, 357, 281, 40, 286, 287, 
+        281, 281, 281, 294, 281, 302, 281, 302, 
+        281, 356, 281, 330, 330, 281, 40, 286, 
+        287, 281, 281, 281, 294, 281, 302, 281, 
+        302, 42, 281, 281, 58, 303, 281, 40, 
+        286, 287, 281, 281, 281, 294, 281, 302, 
+        281, 295, 296, 301, 301, 45, 40, 286, 
+        287, 281, 281, 281, 299, 281, 281, 289, 
+        281, 295, 296, 297, 301, 45, 40, 286, 
+        287, 281, 281, 75, 299, 281, 281, 289, 
+        281, 292, 281, 358, 281, 339, 339, 45, 
+        40, 286, 287, 281, 281, 281, 294, 281, 
+        292, 281, 292, 281, 281, 281, 330, 330, 
+        281, 40, 286, 287, 281, 281, 281, 294, 
+        281, 292, 281, 292, 281, 281, 281, 330, 
+        359, 281, 40, 286, 287, 281, 281, 281, 
+        294, 281, 292, 281, 292, 281, 358, 281, 
+        330, 330, 281, 40, 286, 287, 281, 281, 
+        281, 294, 281, 292, 281, 76, 44, 44, 
+        45, 40, 281, 281, 281, 281, 281, 76, 
+        281, 292, 42, 281, 281, 58, 293, 281, 
+        40, 286, 287, 281, 281, 281, 294, 281, 
+        292, 281, 282, 283, 291, 285, 45, 40, 
+        286, 287, 281, 281, 281, 288, 281, 281, 
+        289, 281, 361, 191, 362, 362, 84, 79, 
+        194, 195, 360, 360, 360, 197, 360, 360, 
+        200, 360, 191, 362, 362, 84, 79, 194, 
+        195, 360, 360, 360, 197, 360, 360, 200, 
+        360, 363, 360, 360, 360, 98, 364, 360, 
+        79, 194, 195, 360, 360, 360, 365, 360, 
+        363, 360, 366, 367, 368, 369, 84, 79, 
+        194, 195, 360, 360, 115, 370, 360, 360, 
+        200, 360, 371, 367, 372, 372, 84, 79, 
+        194, 195, 360, 360, 360, 370, 360, 360, 
+        200, 360, 367, 372, 372, 84, 79, 194, 
+        195, 360, 360, 360, 370, 360, 360, 200, 
+        360, 373, 360, 360, 360, 98, 374, 360, 
+        79, 194, 195, 360, 360, 360, 365, 360, 
+        373, 360, 375, 376, 377, 378, 84, 79, 
+        194, 195, 360, 360, 113, 379, 360, 360, 
+        200, 360, 380, 376, 381, 381, 84, 79, 
+        194, 195, 360, 360, 360, 379, 360, 360, 
+        200, 360, 376, 381, 381, 84, 79, 194, 
+        195, 360, 360, 360, 379, 360, 360, 200, 
+        360, 382, 360, 360, 360, 98, 383, 360, 
+        79, 194, 195, 360, 360, 360, 365, 360, 
+        382, 360, 384, 385, 386, 387, 84, 79, 
+        194, 195, 360, 360, 111, 388, 360, 360, 
+        200, 360, 389, 385, 390, 390, 84, 79, 
+        194, 195, 360, 360, 360, 388, 360, 360, 
+        200, 360, 385, 390, 390, 84, 79, 194, 
+        195, 360, 360, 360, 388, 360, 360, 200, 
+        360, 391, 360, 360, 360, 98, 392, 360, 
+        79, 194, 195, 360, 360, 360, 365, 360, 
+        391, 360, 393, 394, 395, 396, 84, 79, 
+        194, 195, 360, 360, 109, 397, 360, 360, 
+        200, 360, 398, 394, 399, 399, 84, 79, 
+        194, 195, 360, 360, 360, 397, 360, 360, 
+        200, 360, 394, 399, 399, 84, 79, 194, 
+        195, 360, 360, 360, 397, 360, 360, 200, 
+        360, 98, 400, 360, 79, 194, 195, 360, 
+        360, 360, 365, 360, 401, 401, 360, 79, 
+        194, 195, 360, 360, 360, 365, 360, 402, 
+        360, 360, 403, 194, 195, 360, 194, 195, 
+        360, 404, 360, 194, 405, 360, 194, 406, 
+        360, 194, 360, 402, 360, 360, 360, 194, 
+        195, 360, 407, 360, 408, 409, 360, 79, 
+        194, 195, 360, 360, 82, 360, 81, 360, 
+        401, 401, 360, 79, 194, 195, 360, 401, 
+        401, 360, 79, 194, 195, 360, 407, 360, 
+        401, 401, 360, 79, 194, 195, 360, 407, 
+        360, 408, 401, 360, 79, 194, 195, 360, 
+        360, 82, 360, 98, 360, 410, 410, 84, 
+        79, 194, 195, 360, 360, 360, 365, 360, 
+        411, 107, 412, 413, 88, 79, 194, 195, 
+        360, 360, 360, 365, 360, 107, 412, 413, 
+        88, 79, 194, 195, 360, 360, 360, 365, 
+        360, 412, 412, 88, 79, 194, 195, 360, 
+        360, 360, 365, 360, 414, 104, 415, 416, 
+        91, 79, 194, 195, 360, 360, 360, 365, 
+        360, 104, 415, 416, 91, 79, 194, 195, 
+        360, 360, 360, 365, 360, 415, 415, 91, 
+        79, 194, 195, 360, 360, 360, 365, 360, 
+        417, 101, 418, 419, 94, 79, 194, 195, 
+        360, 360, 360, 365, 360, 101, 418, 419, 
+        94, 79, 194, 195, 360, 360, 360, 365, 
+        360, 418, 418, 94, 79, 194, 195, 360, 
+        360, 360, 365, 360, 420, 98, 401, 421, 
+        360, 79, 194, 195, 360, 360, 360, 365, 
+        360, 98, 401, 421, 360, 79, 194, 195, 
+        360, 360, 360, 365, 360, 401, 422, 360, 
+        79, 194, 195, 360, 360, 360, 365, 360, 
+        98, 360, 401, 401, 360, 79, 194, 195, 
+        360, 360, 360, 365, 360, 80, 81, 360, 
+        360, 98, 400, 360, 79, 194, 195, 360, 
+        360, 360, 365, 360, 80, 360, 394, 399, 
+        399, 84, 79, 194, 195, 360, 360, 360, 
+        397, 360, 393, 394, 399, 399, 84, 79, 
+        194, 195, 360, 360, 360, 397, 360, 360, 
+        200, 360, 393, 394, 395, 399, 84, 79, 
+        194, 195, 360, 360, 109, 397, 360, 360, 
+        200, 360, 391, 360, 423, 360, 410, 410, 
+        84, 79, 194, 195, 360, 360, 360, 365, 
+        360, 391, 360, 391, 360, 360, 360, 401, 
+        401, 360, 79, 194, 195, 360, 360, 360, 
+        365, 360, 391, 360, 391, 360, 360, 360, 
+        401, 424, 360, 79, 194, 195, 360, 360, 
+        360, 365, 360, 391, 360, 391, 360, 423, 
+        360, 401, 401, 360, 79, 194, 195, 360, 
+        360, 360, 365, 360, 391, 360, 391, 81, 
+        360, 360, 98, 392, 360, 79, 194, 195, 
+        360, 360, 360, 365, 360, 391, 360, 384, 
+        385, 390, 390, 84, 79, 194, 195, 360, 
+        360, 360, 388, 360, 360, 200, 360, 384, 
+        385, 386, 390, 84, 79, 194, 195, 360, 
+        360, 111, 388, 360, 360, 200, 360, 382, 
+        360, 425, 360, 410, 410, 84, 79, 194, 
+        195, 360, 360, 360, 365, 360, 382, 360, 
+        382, 360, 360, 360, 401, 401, 360, 79, 
+        194, 195, 360, 360, 360, 365, 360, 382, 
+        360, 382, 360, 360, 360, 401, 426, 360, 
+        79, 194, 195, 360, 360, 360, 365, 360, 
+        382, 360, 382, 360, 425, 360, 401, 401, 
+        360, 79, 194, 195, 360, 360, 360, 365, 
+        360, 382, 360, 382, 81, 360, 360, 98, 
+        383, 360, 79, 194, 195, 360, 360, 360, 
+        365, 360, 382, 360, 375, 376, 381, 381, 
+        84, 79, 194, 195, 360, 360, 360, 379, 
+        360, 360, 200, 360, 375, 376, 377, 381, 
+        84, 79, 194, 195, 360, 360, 113, 379, 
+        360, 360, 200, 360, 373, 360, 427, 360, 
+        410, 410, 84, 79, 194, 195, 360, 360, 
+        360, 365, 360, 373, 360, 373, 360, 360, 
+        360, 401, 401, 360, 79, 194, 195, 360, 
+        360, 360, 365, 360, 373, 360, 373, 360, 
+        360, 360, 401, 428, 360, 79, 194, 195, 
+        360, 360, 360, 365, 360, 373, 360, 373, 
+        360, 427, 360, 401, 401, 360, 79, 194, 
+        195, 360, 360, 360, 365, 360, 373, 360, 
+        373, 81, 360, 360, 98, 374, 360, 79, 
+        194, 195, 360, 360, 360, 365, 360, 373, 
+        360, 366, 367, 372, 372, 84, 79, 194, 
+        195, 360, 360, 360, 370, 360, 360, 200, 
+        360, 366, 367, 368, 372, 84, 79, 194, 
+        195, 360, 360, 115, 370, 360, 360, 200, 
+        360, 363, 360, 429, 360, 410, 410, 84, 
+        79, 194, 195, 360, 360, 360, 365, 360, 
+        363, 360, 363, 360, 360, 360, 401, 401, 
+        360, 79, 194, 195, 360, 360, 360, 365, 
+        360, 363, 360, 363, 360, 360, 360, 401, 
+        430, 360, 79, 194, 195, 360, 360, 360, 
+        365, 360, 363, 360, 363, 360, 429, 360, 
+        401, 401, 360, 79, 194, 195, 360, 360, 
+        360, 365, 360, 363, 360, 363, 81, 360, 
+        360, 98, 364, 360, 79, 194, 195, 360, 
+        360, 360, 365, 360, 363, 360, 116, 83, 
+        83, 84, 79, 431, 431, 431, 431, 156, 
+        116, 431, 190, 191, 362, 362, 84, 79, 
+        194, 195, 360, 360, 360, 197, 360, 360, 
+        200, 360, 116, 83, 83, 84, 79, 431, 
+        431, 431, 431, 431, 116, 431, 433, 434, 
+        435, 436, 123, 118, 437, 438, 432, 432, 
+        155, 439, 432, 432, 440, 432, 441, 434, 
+        436, 436, 123, 118, 437, 438, 432, 432, 
+        432, 439, 432, 432, 440, 432, 434, 436, 
+        436, 123, 118, 437, 438, 432, 432, 432, 
+        439, 432, 432, 440, 432, 442, 432, 432, 
+        432, 136, 443, 432, 118, 437, 438, 432, 
+        432, 432, 444, 432, 442, 432, 445, 446, 
+        447, 448, 123, 118, 437, 438, 432, 432, 
+        153, 449, 432, 432, 440, 432, 450, 446, 
+        451, 451, 123, 118, 437, 438, 432, 432, 
+        432, 449, 432, 432, 440, 432, 446, 451, 
+        451, 123, 118, 437, 438, 432, 432, 432, 
+        449, 432, 432, 440, 432, 452, 432, 432, 
+        432, 136, 453, 432, 118, 437, 438, 432, 
+        432, 432, 444, 432, 452, 432, 454, 455, 
+        456, 457, 123, 118, 437, 438, 432, 432, 
+        151, 458, 432, 432, 440, 432, 459, 455, 
+        460, 460, 123, 118, 437, 438, 432, 432, 
+        432, 458, 432, 432, 440, 432, 455, 460, 
+        460, 123, 118, 437, 438, 432, 432, 432, 
+        458, 432, 432, 440, 432, 461, 432, 432, 
+        432, 136, 462, 432, 118, 437, 438, 432, 
+        432, 432, 444, 432, 461, 432, 463, 464, 
+        465, 466, 123, 118, 437, 438, 432, 432, 
+        149, 467, 432, 432, 440, 432, 468, 464, 
+        469, 469, 123, 118, 437, 438, 432, 432, 
+        432, 467, 432, 432, 440, 432, 464, 469, 
+        469, 123, 118, 437, 438, 432, 432, 432, 
+        467, 432, 432, 440, 432, 470, 432, 432, 
+        432, 136, 471, 432, 118, 437, 438, 432, 
+        432, 432, 444, 432, 470, 432, 472, 473, 
+        474, 475, 123, 118, 437, 438, 432, 432, 
+        147, 476, 432, 432, 440, 432, 477, 473, 
+        478, 478, 123, 118, 437, 438, 432, 432, 
+        432, 476, 432, 432, 440, 432, 473, 478, 
+        478, 123, 118, 437, 438, 432, 432, 432, 
+        476, 432, 432, 440, 432, 136, 479, 432, 
+        118, 437, 438, 432, 432, 432, 444, 432, 
+        480, 480, 432, 118, 437, 438, 432, 432, 
+        432, 444, 432, 481, 432, 432, 482, 437, 
+        438, 432, 437, 438, 432, 483, 432, 437, 
+        484, 432, 437, 485, 432, 437, 432, 481, 
+        432, 432, 432, 437, 438, 432, 486, 432, 
+        487, 488, 432, 118, 437, 438, 432, 432, 
+        121, 432, 120, 432, 480, 480, 432, 118, 
+        437, 438, 432, 480, 480, 432, 118, 437, 
+        438, 432, 486, 432, 480, 480, 432, 118, 
+        437, 438, 432, 486, 432, 487, 480, 432, 
+        118, 437, 438, 432, 432, 121, 432, 136, 
+        432, 489, 489, 123, 118, 437, 438, 432, 
+        432, 432, 444, 432, 490, 145, 491, 492, 
+        126, 118, 437, 438, 432, 432, 432, 444, 
+        432, 145, 491, 492, 126, 118, 437, 438, 
+        432, 432, 432, 444, 432, 491, 491, 126, 
+        118, 437, 438, 432, 432, 432, 444, 432, 
+        493, 142, 494, 495, 129, 118, 437, 438, 
+        432, 432, 432, 444, 432, 142, 494, 495, 
+        129, 118, 437, 438, 432, 432, 432, 444, 
+        432, 494, 494, 129, 118, 437, 438, 432, 
+        432, 432, 444, 432, 496, 139, 497, 498, 
+        132, 118, 437, 438, 432, 432, 432, 444, 
+        432, 139, 497, 498, 132, 118, 437, 438, 
+        432, 432, 432, 444, 432, 497, 497, 132, 
+        118, 437, 438, 432, 432, 432, 444, 432, 
+        499, 136, 480, 500, 432, 118, 437, 438, 
+        432, 432, 432, 444, 432, 136, 480, 500, 
+        432, 118, 437, 438, 432, 432, 432, 444, 
+        432, 480, 501, 432, 118, 437, 438, 432, 
+        432, 432, 444, 432, 136, 432, 480, 480, 
+        432, 118, 437, 438, 432, 432, 432, 444, 
+        432, 119, 120, 432, 432, 136, 479, 432, 
+        118, 437, 438, 432, 432, 432, 444, 432, 
+        119, 432, 473, 478, 478, 123, 118, 437, 
+        438, 432, 432, 432, 476, 432, 472, 473, 
+        478, 478, 123, 118, 437, 438, 432, 432, 
+        432, 476, 432, 432, 440, 432, 472, 473, 
+        474, 478, 123, 118, 437, 438, 432, 432, 
+        147, 476, 432, 432, 440, 432, 470, 432, 
+        502, 432, 489, 489, 123, 118, 437, 438, 
+        432, 432, 432, 444, 432, 470, 432, 470, 
+        432, 432, 432, 480, 480, 432, 118, 437, 
+        438, 432, 432, 432, 444, 432, 470, 432, 
+        470, 432, 432, 432, 480, 503, 432, 118, 
+        437, 438, 432, 432, 432, 444, 432, 470, 
+        432, 470, 432, 502, 432, 480, 480, 432, 
+        118, 437, 438, 432, 432, 432, 444, 432, 
+        470, 432, 470, 120, 432, 432, 136, 471, 
+        432, 118, 437, 438, 432, 432, 432, 444, 
+        432, 470, 432, 463, 464, 469, 469, 123, 
+        118, 437, 438, 432, 432, 432, 467, 432, 
+        432, 440, 432, 463, 464, 465, 469, 123, 
+        118, 437, 438, 432, 432, 149, 467, 432, 
+        432, 440, 432, 461, 432, 504, 432, 489, 
+        489, 123, 118, 437, 438, 432, 432, 432, 
+        444, 432, 461, 432, 461, 432, 432, 432, 
+        480, 480, 432, 118, 437, 438, 432, 432, 
+        432, 444, 432, 461, 432, 461, 432, 432, 
+        432, 480, 505, 432, 118, 437, 438, 432, 
+        432, 432, 444, 432, 461, 432, 461, 432, 
+        504, 432, 480, 480, 432, 118, 437, 438, 
+        432, 432, 432, 444, 432, 461, 432, 461, 
+        120, 432, 432, 136, 462, 432, 118, 437, 
+        438, 432, 432, 432, 444, 432, 461, 432, 
+        454, 455, 460, 460, 123, 118, 437, 438, 
+        432, 432, 432, 458, 432, 432, 440, 432, 
+        454, 455, 456, 460, 123, 118, 437, 438, 
+        432, 432, 151, 458, 432, 432, 440, 432, 
+        452, 432, 506, 432, 489, 489, 123, 118, 
+        437, 438, 432, 432, 432, 444, 432, 452, 
+        432, 452, 432, 432, 432, 480, 480, 432, 
+        118, 437, 438, 432, 432, 432, 444, 432, 
+        452, 432, 452, 432, 432, 432, 480, 507, 
+        432, 118, 437, 438, 432, 432, 432, 444, 
+        432, 452, 432, 452, 432, 506, 432, 480, 
+        480, 432, 118, 437, 438, 432, 432, 432, 
+        444, 432, 452, 432, 452, 120, 432, 432, 
+        136, 453, 432, 118, 437, 438, 432, 432, 
+        432, 444, 432, 452, 432, 445, 446, 451, 
+        451, 123, 118, 437, 438, 432, 432, 432, 
+        449, 432, 432, 440, 432, 445, 446, 447, 
+        451, 123, 118, 437, 438, 432, 432, 153, 
+        449, 432, 432, 440, 432, 442, 432, 508, 
+        432, 489, 489, 123, 118, 437, 438, 432, 
+        432, 432, 444, 432, 442, 432, 442, 432, 
+        432, 432, 480, 480, 432, 118, 437, 438, 
+        432, 432, 432, 444, 432, 442, 432, 442, 
+        432, 432, 432, 480, 509, 432, 118, 437, 
+        438, 432, 432, 432, 444, 432, 442, 432, 
+        442, 432, 508, 432, 480, 480, 432, 118, 
+        437, 438, 432, 432, 432, 444, 432, 442, 
+        432, 442, 120, 432, 432, 136, 443, 432, 
+        118, 437, 438, 432, 432, 432, 444, 432, 
+        442, 432, 433, 434, 436, 436, 123, 118, 
+        437, 438, 432, 432, 432, 439, 432, 432, 
+        440, 432, 188, 189, 190, 191, 510, 362, 
+        84, 79, 194, 195, 196, 196, 156, 197, 
+        360, 188, 200, 360, 203, 511, 205, 206, 
+        6, 1, 207, 208, 202, 202, 38, 209, 
+        202, 202, 210, 202, 213, 189, 190, 191, 
+        512, 513, 84, 157, 514, 515, 202, 196, 
+        156, 516, 202, 213, 200, 202, 116, 517, 
+        517, 84, 157, 207, 208, 202, 202, 156, 
+        518, 202, 519, 202, 202, 520, 514, 515, 
+        202, 514, 515, 202, 254, 202, 514, 521, 
+        202, 514, 522, 202, 514, 202, 519, 202, 
+        202, 202, 514, 515, 202, 523, 3, 360, 
+        360, 401, 430, 360, 79, 194, 195, 360, 
+        360, 360, 365, 360, 523, 360, 524, 367, 
+        525, 526, 84, 157, 514, 515, 202, 202, 
+        158, 370, 202, 202, 200, 202, 527, 367, 
+        528, 528, 84, 157, 514, 515, 202, 202, 
+        202, 370, 202, 202, 200, 202, 367, 528, 
+        528, 84, 157, 514, 515, 202, 202, 202, 
+        370, 202, 202, 200, 202, 524, 367, 528, 
+        528, 84, 157, 514, 515, 202, 202, 202, 
+        370, 202, 202, 200, 202, 524, 367, 525, 
+        528, 84, 157, 514, 515, 202, 202, 158, 
+        370, 202, 202, 200, 202, 213, 202, 279, 
+        116, 529, 529, 160, 157, 207, 208, 202, 
+        202, 202, 518, 202, 213, 202, 530, 184, 
+        531, 532, 162, 157, 514, 515, 202, 202, 
+        202, 533, 202, 184, 531, 532, 162, 157, 
+        514, 515, 202, 202, 202, 533, 202, 531, 
+        531, 162, 157, 514, 515, 202, 202, 202, 
+        533, 202, 534, 181, 535, 536, 165, 157, 
+        514, 515, 202, 202, 202, 533, 202, 181, 
+        535, 536, 165, 157, 514, 515, 202, 202, 
+        202, 533, 202, 535, 535, 165, 157, 514, 
+        515, 202, 202, 202, 533, 202, 537, 178, 
+        538, 539, 168, 157, 514, 515, 202, 202, 
+        202, 533, 202, 178, 538, 539, 168, 157, 
+        514, 515, 202, 202, 202, 533, 202, 538, 
+        538, 168, 157, 514, 515, 202, 202, 202, 
+        533, 202, 540, 175, 541, 542, 202, 157, 
+        514, 515, 202, 202, 202, 533, 202, 175, 
+        541, 542, 202, 157, 514, 515, 202, 202, 
+        202, 533, 202, 541, 541, 202, 157, 514, 
+        515, 202, 202, 202, 533, 202, 543, 202, 
+        544, 545, 202, 157, 514, 515, 202, 202, 
+        172, 202, 171, 202, 541, 541, 202, 157, 
+        514, 515, 202, 541, 541, 202, 157, 514, 
+        515, 202, 543, 202, 541, 541, 202, 157, 
+        514, 515, 202, 543, 202, 544, 541, 202, 
+        157, 514, 515, 202, 202, 172, 202, 523, 
+        171, 360, 360, 98, 364, 360, 79, 194, 
+        195, 360, 360, 360, 365, 360, 523, 360, 
+        547, 546, 548, 548, 546, 186, 549, 550, 
+        546, 548, 548, 546, 186, 549, 550, 546, 
+        551, 546, 546, 552, 549, 550, 546, 549, 
+        550, 546, 553, 546, 549, 554, 546, 549, 
+        555, 546, 549, 546, 551, 546, 546, 546, 
         549, 550, 546, 0
 };
 
 static const short _indic_syllable_machine_trans_targs[] = {
-        178, 200, 207, 209, 210, 4, 213, 5,
-        7, 216, 8, 10, 219, 11, 13, 222,
-        14, 16, 17, 199, 19, 20, 221, 22,
-        23, 218, 25, 26, 215, 224, 228, 232,
-        235, 239, 242, 246, 249, 253, 256, 178,
-        279, 286, 288, 289, 41, 292, 42, 44,
-        295, 45, 47, 298, 48, 50, 301, 51,
-        53, 54, 278, 56, 57, 300, 59, 60,
-        297, 62, 63, 294, 303, 307, 311, 314,
-        318, 321, 325, 328, 332, 336, 178, 357,
-        364, 366, 367, 78, 370, 178, 79, 81,
-        373, 82, 84, 376, 85, 87, 379, 88,
-        90, 91, 356, 93, 94, 378, 96, 97,
-        375, 99, 100, 372, 381, 385, 389, 392,
-        396, 399, 403, 406, 410, 178, 437, 444,
-        446, 447, 114, 450, 115, 117, 453, 118,
-        120, 456, 121, 123, 459, 124, 126, 127,
-        436, 129, 130, 458, 132, 133, 455, 135,
-        136, 452, 461, 465, 469, 472, 476, 479,
-        483, 486, 490, 493, 414, 498, 509, 152,
-        512, 154, 515, 155, 157, 518, 158, 160,
-        521, 161, 524, 526, 527, 166, 167, 523,
-        169, 170, 520, 172, 173, 517, 175, 176,
-        514, 178, 532, 178, 179, 258, 337, 339,
-        413, 415, 359, 360, 416, 412, 494, 495,
-        384, 530, 178, 180, 182, 36, 257, 202,
-        203, 255, 227, 181, 35, 183, 251, 1,
-        184, 186, 34, 250, 248, 185, 33, 187,
-        244, 188, 190, 32, 243, 241, 189, 31,
-        191, 237, 192, 194, 30, 236, 234, 193,
-        29, 195, 230, 196, 198, 28, 229, 226,
-        197, 27, 212, 0, 201, 206, 178, 204,
-        205, 208, 2, 211, 3, 214, 6, 24,
-        217, 9, 21, 220, 12, 18, 223, 15,
-        225, 231, 233, 238, 240, 245, 247, 252,
-        254, 178, 259, 261, 73, 334, 281, 282,
-        335, 306, 260, 72, 262, 330, 38, 263,
-        265, 71, 329, 327, 264, 70, 266, 323,
-        267, 269, 69, 322, 320, 268, 68, 270,
-        316, 271, 273, 67, 315, 313, 272, 66,
-        274, 309, 275, 277, 65, 308, 305, 276,
-        64, 291, 37, 280, 285, 178, 283, 284,
-        287, 39, 290, 40, 293, 43, 61, 296,
-        46, 58, 299, 49, 55, 302, 52, 304,
-        310, 312, 317, 319, 324, 326, 331, 333,
-        178, 338, 109, 340, 408, 75, 341, 343,
-        108, 407, 405, 342, 107, 344, 401, 345,
-        347, 106, 400, 398, 346, 105, 348, 394,
-        349, 351, 104, 393, 391, 350, 103, 352,
-        387, 353, 355, 102, 386, 383, 354, 101,
-        369, 74, 358, 363, 178, 361, 362, 365,
-        76, 368, 77, 371, 80, 98, 374, 83,
-        95, 377, 86, 92, 380, 89, 382, 388,
-        390, 395, 397, 402, 404, 409, 411, 178,
-        178, 417, 419, 146, 145, 439, 440, 492,
-        464, 418, 420, 488, 111, 421, 423, 144,
-        487, 485, 422, 143, 424, 481, 425, 427,
-        142, 480, 478, 426, 141, 428, 474, 429,
-        431, 140, 473, 471, 430, 139, 432, 467,
-        433, 435, 138, 466, 463, 434, 137, 449,
-        110, 438, 443, 178, 441, 442, 445, 112,
-        448, 113, 451, 116, 134, 454, 119, 131,
-        457, 122, 128, 460, 125, 462, 468, 470,
-        475, 477, 482, 484, 489, 491, 147, 496,
-        497, 511, 500, 501, 529, 148, 505, 499,
-        504, 502, 503, 506, 507, 150, 510, 508,
-        149, 151, 513, 153, 174, 163, 516, 156,
-        171, 519, 159, 168, 522, 162, 165, 525,
-        164, 528, 178, 531, 177, 534, 535, 533,
+        178, 200, 207, 209, 210, 4, 213, 5, 
+        7, 216, 8, 10, 219, 11, 13, 222, 
+        14, 16, 17, 199, 19, 20, 221, 22, 
+        23, 218, 25, 26, 215, 224, 228, 232, 
+        235, 239, 242, 246, 249, 253, 256, 178, 
+        279, 286, 288, 289, 41, 292, 42, 44, 
+        295, 45, 47, 298, 48, 50, 301, 51, 
+        53, 54, 278, 56, 57, 300, 59, 60, 
+        297, 62, 63, 294, 303, 307, 311, 314, 
+        318, 321, 325, 328, 332, 336, 178, 357, 
+        364, 366, 367, 78, 370, 178, 79, 81, 
+        373, 82, 84, 376, 85, 87, 379, 88, 
+        90, 91, 356, 93, 94, 378, 96, 97, 
+        375, 99, 100, 372, 381, 385, 389, 392, 
+        396, 399, 403, 406, 410, 178, 437, 444, 
+        446, 447, 114, 450, 115, 117, 453, 118, 
+        120, 456, 121, 123, 459, 124, 126, 127, 
+        436, 129, 130, 458, 132, 133, 455, 135, 
+        136, 452, 461, 465, 469, 472, 476, 479, 
+        483, 486, 490, 493, 414, 498, 509, 152, 
+        512, 154, 515, 155, 157, 518, 158, 160, 
+        521, 161, 524, 526, 527, 166, 167, 523, 
+        169, 170, 520, 172, 173, 517, 175, 176, 
+        514, 178, 532, 178, 179, 258, 337, 339, 
+        413, 415, 359, 360, 416, 412, 494, 495, 
+        384, 530, 178, 180, 182, 36, 257, 202, 
+        203, 255, 227, 181, 35, 183, 251, 1, 
+        184, 186, 34, 250, 248, 185, 33, 187, 
+        244, 188, 190, 32, 243, 241, 189, 31, 
+        191, 237, 192, 194, 30, 236, 234, 193, 
+        29, 195, 230, 196, 198, 28, 229, 226, 
+        197, 27, 212, 0, 201, 206, 178, 204, 
+        205, 208, 2, 211, 3, 214, 6, 24, 
+        217, 9, 21, 220, 12, 18, 223, 15, 
+        225, 231, 233, 238, 240, 245, 247, 252, 
+        254, 178, 259, 261, 73, 334, 281, 282, 
+        335, 306, 260, 72, 262, 330, 38, 263, 
+        265, 71, 329, 327, 264, 70, 266, 323, 
+        267, 269, 69, 322, 320, 268, 68, 270, 
+        316, 271, 273, 67, 315, 313, 272, 66, 
+        274, 309, 275, 277, 65, 308, 305, 276, 
+        64, 291, 37, 280, 285, 178, 283, 284, 
+        287, 39, 290, 40, 293, 43, 61, 296, 
+        46, 58, 299, 49, 55, 302, 52, 304, 
+        310, 312, 317, 319, 324, 326, 331, 333, 
+        178, 338, 109, 340, 408, 75, 341, 343, 
+        108, 407, 405, 342, 107, 344, 401, 345, 
+        347, 106, 400, 398, 346, 105, 348, 394, 
+        349, 351, 104, 393, 391, 350, 103, 352, 
+        387, 353, 355, 102, 386, 383, 354, 101, 
+        369, 74, 358, 363, 178, 361, 362, 365, 
+        76, 368, 77, 371, 80, 98, 374, 83, 
+        95, 377, 86, 92, 380, 89, 382, 388, 
+        390, 395, 397, 402, 404, 409, 411, 178, 
+        178, 417, 419, 146, 145, 439, 440, 492, 
+        464, 418, 420, 488, 111, 421, 423, 144, 
+        487, 485, 422, 143, 424, 481, 425, 427, 
+        142, 480, 478, 426, 141, 428, 474, 429, 
+        431, 140, 473, 471, 430, 139, 432, 467, 
+        433, 435, 138, 466, 463, 434, 137, 449, 
+        110, 438, 443, 178, 441, 442, 445, 112, 
+        448, 113, 451, 116, 134, 454, 119, 131, 
+        457, 122, 128, 460, 125, 462, 468, 470, 
+        475, 477, 482, 484, 489, 491, 147, 496, 
+        497, 511, 500, 501, 529, 148, 505, 499, 
+        504, 502, 503, 506, 507, 150, 510, 508, 
+        149, 151, 513, 153, 174, 163, 516, 156, 
+        171, 519, 159, 168, 522, 162, 165, 525, 
+        164, 528, 178, 531, 177, 534, 535, 533, 
         538, 178, 536, 537
 };
 
 static const char _indic_syllable_machine_trans_actions[] = {
-        1, 0, 2, 2, 2, 0, 2, 0,
-        0, 2, 0, 0, 2, 0, 0, 2,
-        0, 0, 0, 2, 0, 0, 2, 0,
-        0, 2, 0, 0, 2, 2, 2, 2,
-        2, 2, 2, 2, 2, 2, 2, 3,
-        0, 2, 2, 2, 0, 2, 0, 0,
-        2, 0, 0, 2, 0, 0, 2, 0,
-        0, 0, 2, 0, 0, 2, 0, 0,
-        2, 0, 0, 2, 2, 2, 2, 2,
-        2, 2, 2, 2, 2, 2, 4, 0,
-        2, 2, 2, 0, 2, 5, 0, 0,
-        2, 0, 0, 2, 0, 0, 2, 0,
-        0, 0, 2, 0, 0, 2, 0, 0,
-        2, 0, 0, 2, 2, 6, 2, 6,
-        2, 6, 2, 6, 2, 7, 0, 2,
-        2, 2, 0, 2, 0, 0, 2, 0,
-        0, 2, 0, 0, 2, 0, 0, 0,
-        2, 0, 0, 2, 0, 0, 2, 0,
-        0, 2, 2, 2, 2, 2, 2, 2,
-        2, 2, 2, 2, 6, 0, 8, 0,
-        2, 0, 2, 0, 0, 2, 0, 0,
-        2, 0, 2, 2, 2, 0, 0, 2,
-        0, 0, 2, 0, 0, 2, 0, 0,
-        2, 9, 0, 12, 2, 2, 6, 2,
-        13, 13, 0, 0, 2, 2, 6, 2,
-        6, 2, 14, 2, 2, 0, 2, 0,
-        0, 2, 2, 2, 0, 2, 2, 0,
-        2, 2, 0, 2, 2, 2, 0, 2,
-        2, 2, 2, 0, 2, 2, 2, 0,
-        2, 2, 2, 2, 0, 2, 2, 2,
-        0, 2, 2, 2, 2, 0, 2, 2,
-        2, 0, 2, 0, 0, 0, 15, 0,
-        0, 2, 0, 2, 0, 2, 0, 0,
-        2, 0, 0, 2, 0, 0, 2, 0,
-        2, 2, 2, 2, 2, 2, 2, 2,
-        2, 16, 2, 2, 0, 2, 0, 0,
-        2, 2, 2, 0, 2, 2, 0, 2,
-        2, 0, 2, 2, 2, 0, 2, 2,
-        2, 2, 0, 2, 2, 2, 0, 2,
-        2, 2, 2, 0, 2, 2, 2, 0,
-        2, 2, 2, 2, 0, 2, 2, 2,
-        0, 2, 0, 0, 0, 17, 0, 0,
-        2, 0, 2, 0, 2, 0, 0, 2,
-        0, 0, 2, 0, 0, 2, 0, 2,
-        2, 2, 2, 2, 2, 2, 2, 2,
-        18, 6, 0, 6, 6, 0, 6, 2,
-        0, 6, 2, 6, 0, 6, 6, 6,
-        2, 0, 6, 2, 6, 0, 6, 6,
-        6, 2, 0, 6, 2, 6, 0, 6,
-        6, 6, 2, 0, 6, 2, 6, 0,
-        6, 0, 0, 0, 19, 0, 0, 2,
-        0, 2, 0, 2, 0, 0, 2, 0,
-        0, 2, 0, 0, 2, 0, 2, 2,
-        2, 2, 2, 2, 2, 2, 2, 20,
-        21, 2, 2, 0, 0, 0, 0, 2,
-        2, 2, 2, 2, 0, 2, 2, 0,
-        2, 2, 2, 0, 2, 2, 2, 2,
-        0, 2, 2, 2, 0, 2, 2, 2,
-        2, 0, 2, 2, 2, 0, 2, 2,
-        2, 2, 0, 2, 2, 2, 0, 2,
-        0, 0, 0, 22, 0, 0, 2, 0,
-        2, 0, 2, 0, 0, 2, 0, 0,
-        2, 0, 0, 2, 0, 2, 2, 2,
-        2, 2, 2, 2, 2, 2, 0, 0,
-        8, 2, 0, 0, 2, 0, 2, 0,
-        0, 0, 0, 8, 8, 0, 8, 8,
-        0, 0, 2, 0, 0, 0, 2, 0,
-        0, 2, 0, 0, 2, 0, 0, 2,
-        0, 2, 23, 2, 0, 0, 0, 0,
+        1, 0, 2, 2, 2, 0, 2, 0, 
+        0, 2, 0, 0, 2, 0, 0, 2, 
+        0, 0, 0, 2, 0, 0, 2, 0, 
+        0, 2, 0, 0, 2, 2, 2, 2, 
+        2, 2, 2, 2, 2, 2, 2, 3, 
+        0, 2, 2, 2, 0, 2, 0, 0, 
+        2, 0, 0, 2, 0, 0, 2, 0, 
+        0, 0, 2, 0, 0, 2, 0, 0, 
+        2, 0, 0, 2, 2, 2, 2, 2, 
+        2, 2, 2, 2, 2, 2, 4, 0, 
+        2, 2, 2, 0, 2, 5, 0, 0, 
+        2, 0, 0, 2, 0, 0, 2, 0, 
+        0, 0, 2, 0, 0, 2, 0, 0, 
+        2, 0, 0, 2, 2, 6, 2, 6, 
+        2, 6, 2, 6, 2, 7, 0, 2, 
+        2, 2, 0, 2, 0, 0, 2, 0, 
+        0, 2, 0, 0, 2, 0, 0, 0, 
+        2, 0, 0, 2, 0, 0, 2, 0, 
+        0, 2, 2, 2, 2, 2, 2, 2, 
+        2, 2, 2, 2, 6, 0, 8, 0, 
+        2, 0, 2, 0, 0, 2, 0, 0, 
+        2, 0, 2, 2, 2, 0, 0, 2, 
+        0, 0, 2, 0, 0, 2, 0, 0, 
+        2, 9, 0, 12, 2, 2, 6, 2, 
+        13, 13, 0, 0, 2, 2, 6, 2, 
+        6, 2, 14, 2, 2, 0, 2, 0, 
+        0, 2, 2, 2, 0, 2, 2, 0, 
+        2, 2, 0, 2, 2, 2, 0, 2, 
+        2, 2, 2, 0, 2, 2, 2, 0, 
+        2, 2, 2, 2, 0, 2, 2, 2, 
+        0, 2, 2, 2, 2, 0, 2, 2, 
+        2, 0, 2, 0, 0, 0, 15, 0, 
+        0, 2, 0, 2, 0, 2, 0, 0, 
+        2, 0, 0, 2, 0, 0, 2, 0, 
+        2, 2, 2, 2, 2, 2, 2, 2, 
+        2, 16, 2, 2, 0, 2, 0, 0, 
+        2, 2, 2, 0, 2, 2, 0, 2, 
+        2, 0, 2, 2, 2, 0, 2, 2, 
+        2, 2, 0, 2, 2, 2, 0, 2, 
+        2, 2, 2, 0, 2, 2, 2, 0, 
+        2, 2, 2, 2, 0, 2, 2, 2, 
+        0, 2, 0, 0, 0, 17, 0, 0, 
+        2, 0, 2, 0, 2, 0, 0, 2, 
+        0, 0, 2, 0, 0, 2, 0, 2, 
+        2, 2, 2, 2, 2, 2, 2, 2, 
+        18, 6, 0, 6, 6, 0, 6, 2, 
+        0, 6, 2, 6, 0, 6, 6, 6, 
+        2, 0, 6, 2, 6, 0, 6, 6, 
+        6, 2, 0, 6, 2, 6, 0, 6, 
+        6, 6, 2, 0, 6, 2, 6, 0, 
+        6, 0, 0, 0, 19, 0, 0, 2, 
+        0, 2, 0, 2, 0, 0, 2, 0, 
+        0, 2, 0, 0, 2, 0, 2, 2, 
+        2, 2, 2, 2, 2, 2, 2, 20, 
+        21, 2, 2, 0, 0, 0, 0, 2, 
+        2, 2, 2, 2, 0, 2, 2, 0, 
+        2, 2, 2, 0, 2, 2, 2, 2, 
+        0, 2, 2, 2, 0, 2, 2, 2, 
+        2, 0, 2, 2, 2, 0, 2, 2, 
+        2, 2, 0, 2, 2, 2, 0, 2, 
+        0, 0, 0, 22, 0, 0, 2, 0, 
+        2, 0, 2, 0, 0, 2, 0, 0, 
+        2, 0, 0, 2, 0, 2, 2, 2, 
+        2, 2, 2, 2, 2, 2, 0, 0, 
+        8, 2, 0, 0, 2, 0, 2, 0, 
+        0, 0, 0, 8, 8, 0, 8, 8, 
+        0, 0, 2, 0, 0, 0, 2, 0, 
+        0, 2, 0, 0, 2, 0, 0, 2, 
+        0, 2, 23, 2, 0, 0, 0, 0, 
         0, 24, 0, 0
 };
 
 static const char _indic_syllable_machine_to_state_actions[] = {
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 10, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 10, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
         0, 0, 0
 };
 
 static const char _indic_syllable_machine_from_state_actions[] = {
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 11, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 11, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
         0, 0, 0
 };
 
 static const short _indic_syllable_machine_eof_trans[] = {
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 40, 40, 40,
-        40, 40, 40, 40, 40, 40, 40, 40,
-        40, 40, 40, 40, 40, 40, 40, 40,
-        40, 40, 40, 40, 40, 40, 40, 40,
-        40, 40, 40, 40, 40, 40, 40, 40,
-        40, 40, 79, 79, 79, 79, 86, 86,
-        79, 79, 79, 79, 79, 79, 79, 79,
-        79, 79, 79, 79, 79, 79, 79, 79,
-        79, 79, 79, 79, 79, 79, 79, 79,
-        79, 79, 79, 79, 79, 79, 118, 118,
-        118, 118, 118, 118, 118, 118, 118, 118,
-        118, 118, 118, 118, 118, 118, 118, 118,
-        118, 118, 118, 118, 118, 118, 118, 118,
-        118, 118, 118, 118, 118, 118, 118, 118,
-        118, 118, 118, 79, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 186, 0, 203, 203, 203, 203, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 203, 282, 282, 282, 282, 282, 282,
-        282, 282, 282, 282, 282, 282, 282, 282,
-        282, 282, 282, 282, 282, 282, 282, 282,
-        282, 282, 282, 282, 282, 282, 282, 282,
-        282, 282, 282, 282, 282, 282, 282, 282,
-        282, 282, 282, 282, 282, 282, 282, 282,
-        282, 282, 282, 282, 282, 282, 282, 282,
-        282, 282, 282, 282, 282, 282, 282, 282,
-        282, 282, 282, 282, 282, 282, 282, 282,
-        282, 282, 282, 282, 282, 282, 282, 282,
-        282, 361, 361, 361, 361, 361, 361, 361,
-        361, 361, 361, 361, 361, 361, 361, 361,
-        361, 361, 361, 361, 361, 361, 361, 361,
-        361, 361, 361, 361, 361, 361, 361, 361,
-        361, 361, 361, 361, 361, 361, 361, 361,
-        361, 361, 361, 361, 361, 361, 361, 361,
-        361, 361, 361, 361, 361, 361, 361, 361,
-        361, 361, 361, 361, 361, 361, 361, 361,
-        361, 361, 361, 361, 361, 361, 361, 361,
-        361, 361, 361, 361, 361, 432, 361, 432,
-        433, 433, 433, 433, 433, 433, 433, 433,
-        433, 433, 433, 433, 433, 433, 433, 433,
-        433, 433, 433, 433, 433, 433, 433, 433,
-        433, 433, 433, 433, 433, 433, 433, 433,
-        433, 433, 433, 433, 433, 433, 433, 433,
-        433, 433, 433, 433, 433, 433, 433, 433,
-        433, 433, 433, 433, 433, 433, 433, 433,
-        433, 433, 433, 433, 433, 433, 433, 433,
-        433, 433, 433, 433, 433, 433, 433, 433,
-        433, 433, 433, 433, 433, 433, 361, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 361, 203, 203, 203, 203, 203, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 203, 203, 203, 203, 203, 203, 203,
-        203, 361, 547, 547, 547, 547, 547, 547,
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 40, 40, 40, 
+        40, 40, 40, 40, 40, 40, 40, 40, 
+        40, 40, 40, 40, 40, 40, 40, 40, 
+        40, 40, 40, 40, 40, 40, 40, 40, 
+        40, 40, 40, 40, 40, 40, 40, 40, 
+        40, 40, 79, 79, 79, 79, 86, 86, 
+        79, 79, 79, 79, 79, 79, 79, 79, 
+        79, 79, 79, 79, 79, 79, 79, 79, 
+        79, 79, 79, 79, 79, 79, 79, 79, 
+        79, 79, 79, 79, 79, 79, 118, 118, 
+        118, 118, 118, 118, 118, 118, 118, 118, 
+        118, 118, 118, 118, 118, 118, 118, 118, 
+        118, 118, 118, 118, 118, 118, 118, 118, 
+        118, 118, 118, 118, 118, 118, 118, 118, 
+        118, 118, 118, 79, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 1, 1, 1, 1, 1, 1, 1, 
+        1, 186, 0, 203, 203, 203, 203, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 203, 282, 282, 282, 282, 282, 282, 
+        282, 282, 282, 282, 282, 282, 282, 282, 
+        282, 282, 282, 282, 282, 282, 282, 282, 
+        282, 282, 282, 282, 282, 282, 282, 282, 
+        282, 282, 282, 282, 282, 282, 282, 282, 
+        282, 282, 282, 282, 282, 282, 282, 282, 
+        282, 282, 282, 282, 282, 282, 282, 282, 
+        282, 282, 282, 282, 282, 282, 282, 282, 
+        282, 282, 282, 282, 282, 282, 282, 282, 
+        282, 282, 282, 282, 282, 282, 282, 282, 
+        282, 361, 361, 361, 361, 361, 361, 361, 
+        361, 361, 361, 361, 361, 361, 361, 361, 
+        361, 361, 361, 361, 361, 361, 361, 361, 
+        361, 361, 361, 361, 361, 361, 361, 361, 
+        361, 361, 361, 361, 361, 361, 361, 361, 
+        361, 361, 361, 361, 361, 361, 361, 361, 
+        361, 361, 361, 361, 361, 361, 361, 361, 
+        361, 361, 361, 361, 361, 361, 361, 361, 
+        361, 361, 361, 361, 361, 361, 361, 361, 
+        361, 361, 361, 361, 361, 432, 361, 432, 
+        433, 433, 433, 433, 433, 433, 433, 433, 
+        433, 433, 433, 433, 433, 433, 433, 433, 
+        433, 433, 433, 433, 433, 433, 433, 433, 
+        433, 433, 433, 433, 433, 433, 433, 433, 
+        433, 433, 433, 433, 433, 433, 433, 433, 
+        433, 433, 433, 433, 433, 433, 433, 433, 
+        433, 433, 433, 433, 433, 433, 433, 433, 
+        433, 433, 433, 433, 433, 433, 433, 433, 
+        433, 433, 433, 433, 433, 433, 433, 433, 
+        433, 433, 433, 433, 433, 433, 361, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 361, 203, 203, 203, 203, 203, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 203, 203, 203, 203, 203, 203, 203, 
+        203, 361, 547, 547, 547, 547, 547, 547, 
         547, 547, 547
 };
 
@@ -1377,7 +1377,7 @@
   unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED;
   int cs;
   hb_glyph_info_t *info = buffer->info;
-
+  
 #line 1382 "hb-ot-shape-complex-indic-machine.hh"
         {
         cs = indic_syllable_machine_start;
@@ -1394,7 +1394,7 @@
 
   unsigned int last = 0;
   unsigned int syllable_serial = 1;
-
+  
 #line 1399 "hb-ot-shape-complex-indic-machine.hh"
         {
         int _slen;
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -1713,33 +1713,28 @@
   switch (ab)
   {
     /* Don't decompose these. */
-    case 0x0931u  : return false;
-    case 0x0B94u  : return false;
+    case 0x0931u  : return false; /* DEVANAGARI LETTER RRA */
+    case 0x0B94u  : return false; /* TAMIL LETTER AU */
 
 
     /*
      * Decompose split matras that don't have Unicode decompositions.
      */
 
-    case 0x0F77u  : *a = 0x0FB2u; *b= 0x0F81u; return true;
-    case 0x0F79u  : *a = 0x0FB3u; *b= 0x0F81u; return true;
+    /* Khmer */
     case 0x17BEu  : *a = 0x17C1u; *b= 0x17BEu; return true;
     case 0x17BFu  : *a = 0x17C1u; *b= 0x17BFu; return true;
     case 0x17C0u  : *a = 0x17C1u; *b= 0x17C0u; return true;
     case 0x17C4u  : *a = 0x17C1u; *b= 0x17C4u; return true;
     case 0x17C5u  : *a = 0x17C1u; *b= 0x17C5u; return true;
-    case 0x1925u  : *a = 0x1920u; *b= 0x1923u; return true;
-    case 0x1926u  : *a = 0x1920u; *b= 0x1924u; return true;
-    case 0x1B3Cu  : *a = 0x1B42u; *b= 0x1B3Cu; return true;
-    case 0x1112Eu  : *a = 0x11127u; *b= 0x11131u; return true;
-    case 0x1112Fu  : *a = 0x11127u; *b= 0x11132u; return true;
+
 #if 0
+    /* Gujarati */
     /* This one has no decomposition in Unicode, but needs no decomposition either. */
     /* case 0x0AC9u  : return false; */
+
+    /* Oriya */
     case 0x0B57u  : *a = no decomp, -> RIGHT; return true;
-    case 0x1C29u  : *a = no decomp, -> LEFT; return true;
-    case 0xA9C0u  : *a = no decomp, -> RIGHT; return true;
-    case 0x111BuF  : *a = no decomp, -> ABOVE; return true;
 #endif
   }
 
@@ -1819,6 +1814,7 @@
   decompose_indic,
   compose_indic,
   setup_masks_indic,
+  NULL, /* disable_otl */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
   false, /* fallback_position */
 };
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar-machine.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar-machine.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -34,223 +34,223 @@
 
 #line 36 "../../src/hb-ot-shape-complex-myanmar-machine.hh.tmp"
 static const unsigned char _myanmar_syllable_machine_trans_keys[] = {
-        1u, 31u, 3u, 30u, 5u, 29u, 5u, 8u, 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u,
-        3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 1u, 16u, 3u, 29u, 3u, 29u, 3u, 29u,
-        3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 5u, 29u, 5u, 8u,
-        5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u,
-        3u, 30u, 3u, 29u, 1u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u,
+        1u, 31u, 3u, 30u, 5u, 29u, 5u, 8u, 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, 
+        3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 1u, 16u, 3u, 29u, 3u, 29u, 3u, 29u, 
+        3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 5u, 29u, 5u, 8u, 
+        5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 
+        3u, 30u, 3u, 29u, 1u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 
         3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 8u, 8u, 0
 };
 
 static const char _myanmar_syllable_machine_key_spans[] = {
-        31, 28, 25, 4, 25, 23, 21, 21,
-        27, 27, 27, 27, 16, 27, 27, 27,
-        27, 27, 27, 27, 27, 27, 25, 4,
-        25, 23, 21, 21, 27, 27, 27, 27,
-        28, 27, 30, 27, 27, 27, 27, 27,
+        31, 28, 25, 4, 25, 23, 21, 21, 
+        27, 27, 27, 27, 16, 27, 27, 27, 
+        27, 27, 27, 27, 27, 27, 25, 4, 
+        25, 23, 21, 21, 27, 27, 27, 27, 
+        28, 27, 30, 27, 27, 27, 27, 27, 
         27, 27, 27, 27, 1
 };
 
 static const short _myanmar_syllable_machine_index_offsets[] = {
-        0, 32, 61, 87, 92, 118, 142, 164,
-        186, 214, 242, 270, 298, 315, 343, 371,
-        399, 427, 455, 483, 511, 539, 567, 593,
-        598, 624, 648, 670, 692, 720, 748, 776,
-        804, 833, 861, 892, 920, 948, 976, 1004,
+        0, 32, 61, 87, 92, 118, 142, 164, 
+        186, 214, 242, 270, 298, 315, 343, 371, 
+        399, 427, 455, 483, 511, 539, 567, 593, 
+        598, 624, 648, 670, 692, 720, 748, 776, 
+        804, 833, 861, 892, 920, 948, 976, 1004, 
         1032, 1060, 1088, 1116, 1144
 };
 
 static const char _myanmar_syllable_machine_indicies[] = {
-        1, 1, 2, 3, 4, 4, 0, 5,
-        0, 6, 1, 0, 0, 0, 0, 7,
-        0, 8, 1, 0, 9, 10, 11, 12,
-        13, 14, 15, 16, 17, 18, 19, 0,
-        21, 22, 23, 23, 20, 24, 20, 25,
-        20, 20, 20, 20, 20, 20, 20, 26,
-        20, 20, 27, 28, 29, 30, 31, 32,
-        33, 34, 35, 36, 20, 23, 23, 20,
-        24, 20, 20, 20, 20, 20, 20, 20,
-        20, 20, 37, 20, 20, 20, 20, 20,
-        20, 31, 20, 20, 20, 35, 20, 23,
-        23, 20, 24, 20, 23, 23, 20, 24,
-        20, 20, 20, 20, 20, 20, 20, 20,
-        20, 20, 20, 20, 20, 20, 20, 20,
-        31, 20, 20, 20, 35, 20, 38, 20,
-        23, 23, 20, 24, 20, 31, 20, 20,
-        20, 20, 20, 20, 20, 39, 20, 20,
-        20, 20, 20, 20, 31, 20, 23, 23,
-        20, 24, 20, 20, 20, 20, 20, 20,
-        20, 20, 20, 39, 20, 20, 20, 20,
-        20, 20, 31, 20, 23, 23, 20, 24,
-        20, 20, 20, 20, 20, 20, 20, 20,
-        20, 20, 20, 20, 20, 20, 20, 20,
-        31, 20, 21, 20, 23, 23, 20, 24,
-        20, 25, 20, 20, 20, 20, 20, 20,
-        20, 40, 20, 20, 40, 20, 20, 20,
-        31, 41, 20, 20, 35, 20, 21, 20,
-        23, 23, 20, 24, 20, 25, 20, 20,
-        20, 20, 20, 20, 20, 20, 20, 20,
-        20, 20, 20, 20, 31, 20, 20, 20,
-        35, 20, 21, 20, 23, 23, 20, 24,
-        20, 25, 20, 20, 20, 20, 20, 20,
-        20, 40, 20, 20, 20, 20, 20, 20,
-        31, 41, 20, 20, 35, 20, 21, 20,
-        23, 23, 20, 24, 20, 25, 20, 20,
-        20, 20, 20, 20, 20, 20, 20, 20,
-        20, 20, 20, 20, 31, 41, 20, 20,
-        35, 20, 1, 1, 20, 20, 20, 20,
-        20, 20, 20, 20, 20, 20, 20, 20,
-        20, 1, 20, 21, 20, 23, 23, 20,
-        24, 20, 25, 20, 20, 20, 20, 20,
-        20, 20, 26, 20, 20, 27, 28, 29,
-        30, 31, 32, 33, 34, 35, 20, 21,
-        20, 23, 23, 20, 24, 20, 25, 20,
-        20, 20, 20, 20, 20, 20, 34, 20,
-        20, 20, 20, 20, 20, 31, 32, 33,
-        34, 35, 20, 21, 20, 23, 23, 20,
-        24, 20, 25, 20, 20, 20, 20, 20,
-        20, 20, 20, 20, 20, 20, 20, 20,
-        20, 31, 32, 33, 34, 35, 20, 21,
-        20, 23, 23, 20, 24, 20, 25, 20,
-        20, 20, 20, 20, 20, 20, 20, 20,
-        20, 20, 20, 20, 20, 31, 32, 33,
-        20, 35, 20, 21, 20, 23, 23, 20,
-        24, 20, 25, 20, 20, 20, 20, 20,
-        20, 20, 20, 20, 20, 20, 20, 20,
-        20, 31, 20, 33, 20, 35, 20, 21,
-        20, 23, 23, 20, 24, 20, 25, 20,
-        20, 20, 20, 20, 20, 20, 34, 20,
-        20, 27, 20, 29, 20, 31, 32, 33,
-        34, 35, 20, 21, 20, 23, 23, 20,
-        24, 20, 25, 20, 20, 20, 20, 20,
-        20, 20, 34, 20, 20, 27, 20, 20,
-        20, 31, 32, 33, 34, 35, 20, 21,
-        20, 23, 23, 20, 24, 20, 25, 20,
-        20, 20, 20, 20, 20, 20, 34, 20,
-        20, 27, 28, 29, 20, 31, 32, 33,
-        34, 35, 20, 21, 22, 23, 23, 20,
-        24, 20, 25, 20, 20, 20, 20, 20,
-        20, 20, 26, 20, 20, 27, 28, 29,
-        30, 31, 32, 33, 34, 35, 20, 3,
-        3, 42, 5, 42, 42, 42, 42, 42,
-        42, 42, 42, 42, 43, 42, 42, 42,
-        42, 42, 42, 13, 42, 42, 42, 17,
-        42, 3, 3, 42, 5, 42, 3, 3,
-        42, 5, 42, 42, 42, 42, 42, 42,
-        42, 42, 42, 42, 42, 42, 42, 42,
-        42, 42, 13, 42, 42, 42, 17, 42,
-        44, 42, 3, 3, 42, 5, 42, 13,
-        42, 42, 42, 42, 42, 42, 42, 45,
-        42, 42, 42, 42, 42, 42, 13, 42,
-        3, 3, 42, 5, 42, 42, 42, 42,
-        42, 42, 42, 42, 42, 45, 42, 42,
-        42, 42, 42, 42, 13, 42, 3, 3,
-        42, 5, 42, 42, 42, 42, 42, 42,
-        42, 42, 42, 42, 42, 42, 42, 42,
-        42, 42, 13, 42, 2, 42, 3, 3,
-        42, 5, 42, 6, 42, 42, 42, 42,
-        42, 42, 42, 46, 42, 42, 46, 42,
-        42, 42, 13, 47, 42, 42, 17, 42,
-        2, 42, 3, 3, 42, 5, 42, 6,
-        42, 42, 42, 42, 42, 42, 42, 42,
-        42, 42, 42, 42, 42, 42, 13, 42,
-        42, 42, 17, 42, 2, 42, 3, 3,
-        42, 5, 42, 6, 42, 42, 42, 42,
-        42, 42, 42, 46, 42, 42, 42, 42,
-        42, 42, 13, 47, 42, 42, 17, 42,
-        2, 42, 3, 3, 42, 5, 42, 6,
-        42, 42, 42, 42, 42, 42, 42, 42,
-        42, 42, 42, 42, 42, 42, 13, 47,
-        42, 42, 17, 42, 21, 22, 23, 23,
-        20, 24, 20, 25, 20, 20, 20, 20,
-        20, 20, 20, 48, 20, 20, 27, 28,
-        29, 30, 31, 32, 33, 34, 35, 36,
-        20, 21, 49, 23, 23, 20, 24, 20,
-        25, 20, 20, 20, 20, 20, 20, 20,
-        26, 20, 20, 27, 28, 29, 30, 31,
-        32, 33, 34, 35, 20, 1, 1, 2,
-        3, 3, 3, 42, 5, 42, 6, 1,
-        42, 42, 42, 42, 1, 42, 8, 1,
-        42, 9, 10, 11, 12, 13, 14, 15,
-        16, 17, 18, 42, 2, 42, 3, 3,
-        42, 5, 42, 6, 42, 42, 42, 42,
-        42, 42, 42, 8, 42, 42, 9, 10,
-        11, 12, 13, 14, 15, 16, 17, 42,
-        2, 42, 3, 3, 42, 5, 42, 6,
-        42, 42, 42, 42, 42, 42, 42, 16,
-        42, 42, 42, 42, 42, 42, 13, 14,
-        15, 16, 17, 42, 2, 42, 3, 3,
-        42, 5, 42, 6, 42, 42, 42, 42,
-        42, 42, 42, 42, 42, 42, 42, 42,
-        42, 42, 13, 14, 15, 16, 17, 42,
-        2, 42, 3, 3, 42, 5, 42, 6,
-        42, 42, 42, 42, 42, 42, 42, 42,
-        42, 42, 42, 42, 42, 42, 13, 14,
-        15, 42, 17, 42, 2, 42, 3, 3,
-        42, 5, 42, 6, 42, 42, 42, 42,
-        42, 42, 42, 42, 42, 42, 42, 42,
-        42, 42, 13, 42, 15, 42, 17, 42,
-        2, 42, 3, 3, 42, 5, 42, 6,
-        42, 42, 42, 42, 42, 42, 42, 16,
-        42, 42, 9, 42, 11, 42, 13, 14,
-        15, 16, 17, 42, 2, 42, 3, 3,
-        42, 5, 42, 6, 42, 42, 42, 42,
-        42, 42, 42, 16, 42, 42, 9, 42,
-        42, 42, 13, 14, 15, 16, 17, 42,
-        2, 42, 3, 3, 42, 5, 42, 6,
-        42, 42, 42, 42, 42, 42, 42, 16,
-        42, 42, 9, 10, 11, 42, 13, 14,
-        15, 16, 17, 42, 2, 3, 3, 3,
-        42, 5, 42, 6, 42, 42, 42, 42,
-        42, 42, 42, 8, 42, 42, 9, 10,
-        11, 12, 13, 14, 15, 16, 17, 42,
+        1, 1, 2, 3, 4, 4, 0, 5, 
+        0, 6, 1, 0, 0, 0, 0, 7, 
+        0, 8, 1, 0, 9, 10, 11, 12, 
+        13, 14, 15, 16, 17, 18, 19, 0, 
+        21, 22, 23, 23, 20, 24, 20, 25, 
+        20, 20, 20, 20, 20, 20, 20, 26, 
+        20, 20, 27, 28, 29, 30, 31, 32, 
+        33, 34, 35, 36, 20, 23, 23, 20, 
+        24, 20, 20, 20, 20, 20, 20, 20, 
+        20, 20, 37, 20, 20, 20, 20, 20, 
+        20, 31, 20, 20, 20, 35, 20, 23, 
+        23, 20, 24, 20, 23, 23, 20, 24, 
+        20, 20, 20, 20, 20, 20, 20, 20, 
+        20, 20, 20, 20, 20, 20, 20, 20, 
+        31, 20, 20, 20, 35, 20, 38, 20, 
+        23, 23, 20, 24, 20, 31, 20, 20, 
+        20, 20, 20, 20, 20, 39, 20, 20, 
+        20, 20, 20, 20, 31, 20, 23, 23, 
+        20, 24, 20, 20, 20, 20, 20, 20, 
+        20, 20, 20, 39, 20, 20, 20, 20, 
+        20, 20, 31, 20, 23, 23, 20, 24, 
+        20, 20, 20, 20, 20, 20, 20, 20, 
+        20, 20, 20, 20, 20, 20, 20, 20, 
+        31, 20, 21, 20, 23, 23, 20, 24, 
+        20, 25, 20, 20, 20, 20, 20, 20, 
+        20, 40, 20, 20, 40, 20, 20, 20, 
+        31, 41, 20, 20, 35, 20, 21, 20, 
+        23, 23, 20, 24, 20, 25, 20, 20, 
+        20, 20, 20, 20, 20, 20, 20, 20, 
+        20, 20, 20, 20, 31, 20, 20, 20, 
+        35, 20, 21, 20, 23, 23, 20, 24, 
+        20, 25, 20, 20, 20, 20, 20, 20, 
+        20, 40, 20, 20, 20, 20, 20, 20, 
+        31, 41, 20, 20, 35, 20, 21, 20, 
+        23, 23, 20, 24, 20, 25, 20, 20, 
+        20, 20, 20, 20, 20, 20, 20, 20, 
+        20, 20, 20, 20, 31, 41, 20, 20, 
+        35, 20, 1, 1, 20, 20, 20, 20, 
+        20, 20, 20, 20, 20, 20, 20, 20, 
+        20, 1, 20, 21, 20, 23, 23, 20, 
+        24, 20, 25, 20, 20, 20, 20, 20, 
+        20, 20, 26, 20, 20, 27, 28, 29, 
+        30, 31, 32, 33, 34, 35, 20, 21, 
+        20, 23, 23, 20, 24, 20, 25, 20, 
+        20, 20, 20, 20, 20, 20, 34, 20, 
+        20, 20, 20, 20, 20, 31, 32, 33, 
+        34, 35, 20, 21, 20, 23, 23, 20, 
+        24, 20, 25, 20, 20, 20, 20, 20, 
+        20, 20, 20, 20, 20, 20, 20, 20, 
+        20, 31, 32, 33, 34, 35, 20, 21, 
+        20, 23, 23, 20, 24, 20, 25, 20, 
+        20, 20, 20, 20, 20, 20, 20, 20, 
+        20, 20, 20, 20, 20, 31, 32, 33, 
+        20, 35, 20, 21, 20, 23, 23, 20, 
+        24, 20, 25, 20, 20, 20, 20, 20, 
+        20, 20, 20, 20, 20, 20, 20, 20, 
+        20, 31, 20, 33, 20, 35, 20, 21, 
+        20, 23, 23, 20, 24, 20, 25, 20, 
+        20, 20, 20, 20, 20, 20, 34, 20, 
+        20, 27, 20, 29, 20, 31, 32, 33, 
+        34, 35, 20, 21, 20, 23, 23, 20, 
+        24, 20, 25, 20, 20, 20, 20, 20, 
+        20, 20, 34, 20, 20, 27, 20, 20, 
+        20, 31, 32, 33, 34, 35, 20, 21, 
+        20, 23, 23, 20, 24, 20, 25, 20, 
+        20, 20, 20, 20, 20, 20, 34, 20, 
+        20, 27, 28, 29, 20, 31, 32, 33, 
+        34, 35, 20, 21, 22, 23, 23, 20, 
+        24, 20, 25, 20, 20, 20, 20, 20, 
+        20, 20, 26, 20, 20, 27, 28, 29, 
+        30, 31, 32, 33, 34, 35, 20, 3, 
+        3, 42, 5, 42, 42, 42, 42, 42, 
+        42, 42, 42, 42, 43, 42, 42, 42, 
+        42, 42, 42, 13, 42, 42, 42, 17, 
+        42, 3, 3, 42, 5, 42, 3, 3, 
+        42, 5, 42, 42, 42, 42, 42, 42, 
+        42, 42, 42, 42, 42, 42, 42, 42, 
+        42, 42, 13, 42, 42, 42, 17, 42, 
+        44, 42, 3, 3, 42, 5, 42, 13, 
+        42, 42, 42, 42, 42, 42, 42, 45, 
+        42, 42, 42, 42, 42, 42, 13, 42, 
+        3, 3, 42, 5, 42, 42, 42, 42, 
+        42, 42, 42, 42, 42, 45, 42, 42, 
+        42, 42, 42, 42, 13, 42, 3, 3, 
+        42, 5, 42, 42, 42, 42, 42, 42, 
+        42, 42, 42, 42, 42, 42, 42, 42, 
+        42, 42, 13, 42, 2, 42, 3, 3, 
+        42, 5, 42, 6, 42, 42, 42, 42, 
+        42, 42, 42, 46, 42, 42, 46, 42, 
+        42, 42, 13, 47, 42, 42, 17, 42, 
+        2, 42, 3, 3, 42, 5, 42, 6, 
+        42, 42, 42, 42, 42, 42, 42, 42, 
+        42, 42, 42, 42, 42, 42, 13, 42, 
+        42, 42, 17, 42, 2, 42, 3, 3, 
+        42, 5, 42, 6, 42, 42, 42, 42, 
+        42, 42, 42, 46, 42, 42, 42, 42, 
+        42, 42, 13, 47, 42, 42, 17, 42, 
+        2, 42, 3, 3, 42, 5, 42, 6, 
+        42, 42, 42, 42, 42, 42, 42, 42, 
+        42, 42, 42, 42, 42, 42, 13, 47, 
+        42, 42, 17, 42, 21, 22, 23, 23, 
+        20, 24, 20, 25, 20, 20, 20, 20, 
+        20, 20, 20, 48, 20, 20, 27, 28, 
+        29, 30, 31, 32, 33, 34, 35, 36, 
+        20, 21, 49, 23, 23, 20, 24, 20, 
+        25, 20, 20, 20, 20, 20, 20, 20, 
+        26, 20, 20, 27, 28, 29, 30, 31, 
+        32, 33, 34, 35, 20, 1, 1, 2, 
+        3, 3, 3, 42, 5, 42, 6, 1, 
+        42, 42, 42, 42, 1, 42, 8, 1, 
+        42, 9, 10, 11, 12, 13, 14, 15, 
+        16, 17, 18, 42, 2, 42, 3, 3, 
+        42, 5, 42, 6, 42, 42, 42, 42, 
+        42, 42, 42, 8, 42, 42, 9, 10, 
+        11, 12, 13, 14, 15, 16, 17, 42, 
+        2, 42, 3, 3, 42, 5, 42, 6, 
+        42, 42, 42, 42, 42, 42, 42, 16, 
+        42, 42, 42, 42, 42, 42, 13, 14, 
+        15, 16, 17, 42, 2, 42, 3, 3, 
+        42, 5, 42, 6, 42, 42, 42, 42, 
+        42, 42, 42, 42, 42, 42, 42, 42, 
+        42, 42, 13, 14, 15, 16, 17, 42, 
+        2, 42, 3, 3, 42, 5, 42, 6, 
+        42, 42, 42, 42, 42, 42, 42, 42, 
+        42, 42, 42, 42, 42, 42, 13, 14, 
+        15, 42, 17, 42, 2, 42, 3, 3, 
+        42, 5, 42, 6, 42, 42, 42, 42, 
+        42, 42, 42, 42, 42, 42, 42, 42, 
+        42, 42, 13, 42, 15, 42, 17, 42, 
+        2, 42, 3, 3, 42, 5, 42, 6, 
+        42, 42, 42, 42, 42, 42, 42, 16, 
+        42, 42, 9, 42, 11, 42, 13, 14, 
+        15, 16, 17, 42, 2, 42, 3, 3, 
+        42, 5, 42, 6, 42, 42, 42, 42, 
+        42, 42, 42, 16, 42, 42, 9, 42, 
+        42, 42, 13, 14, 15, 16, 17, 42, 
+        2, 42, 3, 3, 42, 5, 42, 6, 
+        42, 42, 42, 42, 42, 42, 42, 16, 
+        42, 42, 9, 10, 11, 42, 13, 14, 
+        15, 16, 17, 42, 2, 3, 3, 3, 
+        42, 5, 42, 6, 42, 42, 42, 42, 
+        42, 42, 42, 8, 42, 42, 9, 10, 
+        11, 12, 13, 14, 15, 16, 17, 42, 
         51, 50, 0
 };
 
 static const char _myanmar_syllable_machine_trans_targs[] = {
-        0, 1, 22, 0, 0, 23, 29, 32,
-        35, 36, 40, 41, 42, 25, 38, 39,
-        37, 28, 43, 44, 0, 2, 12, 0,
-        3, 9, 13, 14, 18, 19, 20, 5,
-        16, 17, 15, 8, 21, 4, 6, 7,
-        10, 11, 0, 24, 26, 27, 30, 31,
+        0, 1, 22, 0, 0, 23, 29, 32, 
+        35, 36, 40, 41, 42, 25, 38, 39, 
+        37, 28, 43, 44, 0, 2, 12, 0, 
+        3, 9, 13, 14, 18, 19, 20, 5, 
+        16, 17, 15, 8, 21, 4, 6, 7, 
+        10, 11, 0, 24, 26, 27, 30, 31, 
         33, 34, 0, 0
 };
 
 static const char _myanmar_syllable_machine_trans_actions[] = {
-        3, 0, 0, 4, 5, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 6, 0, 0, 7,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 8, 0, 0, 0, 0, 0,
+        3, 0, 0, 4, 5, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 6, 0, 0, 7, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 8, 0, 0, 0, 0, 0, 
         0, 0, 9, 10
 };
 
 static const char _myanmar_syllable_machine_to_state_actions[] = {
-        1, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
+        1, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
         0, 0, 0, 0, 0
 };
 
 static const char _myanmar_syllable_machine_from_state_actions[] = {
-        2, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
+        2, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
         0, 0, 0, 0, 0
 };
 
 static const short _myanmar_syllable_machine_eof_trans[] = {
-        0, 21, 21, 21, 21, 21, 21, 21,
-        21, 21, 21, 21, 21, 21, 21, 21,
-        21, 21, 21, 21, 21, 21, 43, 43,
-        43, 43, 43, 43, 43, 43, 43, 43,
-        21, 21, 43, 43, 43, 43, 43, 43,
+        0, 21, 21, 21, 21, 21, 21, 21, 
+        21, 21, 21, 21, 21, 21, 21, 21, 
+        21, 21, 21, 21, 21, 21, 43, 43, 
+        43, 43, 43, 43, 43, 43, 43, 43, 
+        21, 21, 43, 43, 43, 43, 43, 43, 
         43, 43, 43, 43, 51
 };
 
@@ -284,7 +284,7 @@
   unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED;
   int cs;
   hb_glyph_info_t *info = buffer->info;
-
+  
 #line 289 "../../src/hb-ot-shape-complex-myanmar-machine.hh.tmp"
         {
         cs = myanmar_syllable_machine_start;
@@ -301,7 +301,7 @@
 
   unsigned int last = 0;
   unsigned int syllable_serial = 1;
-
+  
 #line 306 "../../src/hb-ot-shape-complex-myanmar-machine.hh.tmp"
         {
         int _slen;
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -521,6 +521,7 @@
   NULL, /* decompose */
   NULL, /* compose */
   NULL, /* setup_masks */
+  NULL, /* disable_otl */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   true, /* fallback_position */
 };
@@ -538,6 +539,7 @@
   NULL, /* decompose */
   NULL, /* compose */
   setup_masks_myanmar,
+  NULL, /* disable_otl */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
   false, /* fallback_position */
 };
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -146,6 +146,14 @@
                        hb_buffer_t              *buffer,
                        hb_font_t                *font);
 
+  /* disable_otl()
+   * Called during shape().
+   * If set and returns true, GDEF/GSUB/GPOS of the font are ignored
+   * and fallback operations used.
+   * May be NULL.
+   */
+  bool (*disable_otl) (const hb_ot_shape_plan_t *plan);
+
   hb_ot_shape_zero_width_marks_type_t zero_width_marks;
 
   bool fallback_position;
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-thai.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-thai.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -376,6 +376,7 @@
   NULL, /* decompose */
   NULL, /* compose */
   NULL, /* setup_masks */
+  NULL, /* disable_otl */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   false,/* fallback_position */
 };
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-tibetan.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-tibetan.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -57,6 +57,7 @@
   NULL, /* decompose */
   NULL, /* compose */
   NULL, /* setup_masks */
+  NULL, /* disable_otl */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   true, /* fallback_position */
 };
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-machine.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-machine.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -36,247 +36,247 @@
 
 #line 38 "hb-ot-shape-complex-use-machine.hh"
 static const unsigned char _use_syllable_machine_trans_keys[] = {
-        1u, 1u, 0u, 39u, 21u, 21u, 8u, 39u, 8u, 39u, 1u, 1u, 8u, 39u, 8u, 39u,
-        8u, 39u, 8u, 26u, 8u, 26u, 8u, 26u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u,
-        8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 13u, 21u,
-        4u, 4u, 13u, 13u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 26u, 8u, 26u,
-        8u, 26u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u,
-        8u, 39u, 8u, 39u, 8u, 39u, 1u, 1u, 1u, 39u, 8u, 39u, 21u, 42u, 41u, 42u,
+        1u, 1u, 0u, 39u, 21u, 21u, 8u, 39u, 8u, 39u, 1u, 1u, 8u, 39u, 8u, 39u, 
+        8u, 39u, 8u, 26u, 8u, 26u, 8u, 26u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 
+        8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 13u, 21u, 
+        4u, 4u, 13u, 13u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 26u, 8u, 26u, 
+        8u, 26u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 
+        8u, 39u, 8u, 39u, 8u, 39u, 1u, 1u, 1u, 39u, 8u, 39u, 21u, 42u, 41u, 42u, 
         42u, 42u, 0
 };
 
 static const char _use_syllable_machine_key_spans[] = {
-        1, 40, 1, 32, 32, 1, 32, 32,
-        32, 19, 19, 19, 32, 32, 32, 32,
-        32, 32, 32, 32, 32, 32, 32, 9,
-        1, 1, 32, 32, 32, 32, 19, 19,
-        19, 32, 32, 32, 32, 32, 32, 32,
-        32, 32, 32, 1, 39, 32, 22, 2,
+        1, 40, 1, 32, 32, 1, 32, 32, 
+        32, 19, 19, 19, 32, 32, 32, 32, 
+        32, 32, 32, 32, 32, 32, 32, 9, 
+        1, 1, 32, 32, 32, 32, 19, 19, 
+        19, 32, 32, 32, 32, 32, 32, 32, 
+        32, 32, 32, 1, 39, 32, 22, 2, 
         1
 };
 
 static const short _use_syllable_machine_index_offsets[] = {
-        0, 2, 43, 45, 78, 111, 113, 146,
-        179, 212, 232, 252, 272, 305, 338, 371,
-        404, 437, 470, 503, 536, 569, 602, 635,
-        645, 647, 649, 682, 715, 748, 781, 801,
-        821, 841, 874, 907, 940, 973, 1006, 1039,
-        1072, 1105, 1138, 1171, 1173, 1213, 1246, 1269,
+        0, 2, 43, 45, 78, 111, 113, 146, 
+        179, 212, 232, 252, 272, 305, 338, 371, 
+        404, 437, 470, 503, 536, 569, 602, 635, 
+        645, 647, 649, 682, 715, 748, 781, 801, 
+        821, 841, 874, 907, 940, 973, 1006, 1039, 
+        1072, 1105, 1138, 1171, 1173, 1213, 1246, 1269, 
         1272
 };
 
 static const char _use_syllable_machine_indicies[] = {
-        1, 0, 2, 3, 4, 2, 5, 3,
-        4, 4, 6, 4, 4, 1, 7, 4,
-        4, 4, 2, 2, 8, 9, 4, 4,
-        10, 11, 12, 13, 14, 15, 16, 10,
-        17, 18, 19, 20, 21, 22, 4, 23,
-        24, 25, 4, 27, 26, 29, 28, 28,
-        30, 31, 28, 28, 28, 28, 28, 28,
-        28, 28, 32, 33, 34, 35, 36, 37,
-        38, 39, 33, 40, 32, 41, 42, 43,
-        44, 28, 45, 46, 47, 28, 29, 28,
-        28, 30, 31, 28, 28, 28, 28, 28,
-        28, 28, 28, 48, 33, 34, 35, 36,
-        37, 38, 39, 33, 40, 41, 41, 42,
-        43, 44, 28, 45, 46, 47, 28, 30,
-        49, 29, 28, 28, 30, 31, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 33,
-        34, 35, 36, 37, 38, 39, 33, 40,
-        41, 41, 42, 43, 44, 28, 45, 46,
-        47, 28, 29, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        33, 34, 35, 36, 37, 28, 28, 28,
-        28, 28, 28, 42, 43, 44, 28, 45,
-        46, 47, 28, 29, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 34, 35, 36, 37, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        45, 46, 47, 28, 29, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 35, 36, 37, 28,
-        29, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 36, 37, 28, 29, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 37, 28,
-        29, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        35, 36, 37, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 45, 46, 47,
-        28, 29, 28, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 35, 36, 37, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 46,
-        47, 28, 29, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 35, 36, 37, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 47, 28, 29, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 34, 35, 36, 37, 28, 28,
-        28, 28, 28, 28, 42, 43, 44, 28,
-        45, 46, 47, 28, 29, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 28, 34, 35, 36, 37, 28,
-        28, 28, 28, 28, 28, 28, 43, 44,
-        28, 45, 46, 47, 28, 29, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 34, 35, 36, 37,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        44, 28, 45, 46, 47, 28, 29, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 33, 34, 35, 36,
-        37, 28, 39, 33, 28, 28, 28, 42,
-        43, 44, 28, 45, 46, 47, 28, 29,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 33, 34, 35,
-        36, 37, 28, 28, 33, 28, 28, 28,
-        42, 43, 44, 28, 45, 46, 47, 28,
-        29, 28, 28, 28, 28, 28, 28, 28,
-        28, 28, 28, 28, 28, 28, 33, 34,
-        35, 36, 37, 38, 39, 33, 28, 28,
-        28, 42, 43, 44, 28, 45, 46, 47,
-        28, 29, 28, 28, 30, 31, 28, 28,
-        28, 28, 28, 28, 28, 28, 28, 33,
-        34, 35, 36, 37, 38, 39, 33, 40,
-        28, 41, 42, 43, 44, 28, 45, 46,
-        47, 28, 29, 28, 28, 30, 31, 28,
-        28, 28, 28, 28, 28, 28, 28, 28,
-        33, 34, 35, 36, 37, 38, 39, 33,
-        40, 32, 41, 42, 43, 44, 28, 45,
-        46, 47, 28, 51, 50, 50, 50, 50,
-        50, 50, 50, 52, 50, 5, 53, 51,
-        50, 6, 54, 54, 1, 55, 54, 54,
-        54, 54, 54, 54, 54, 54, 56, 10,
-        11, 12, 13, 14, 15, 16, 10, 17,
-        19, 19, 20, 21, 22, 54, 23, 24,
-        25, 54, 6, 54, 54, 1, 55, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        10, 11, 12, 13, 14, 15, 16, 10,
-        17, 19, 19, 20, 21, 22, 54, 23,
-        24, 25, 54, 6, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 10, 11, 12, 13, 14, 54, 54,
-        54, 54, 54, 54, 20, 21, 22, 54,
-        23, 24, 25, 54, 6, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 11, 12, 13, 14, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 23, 24, 25, 54, 6, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 12, 13, 14,
-        54, 6, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 13, 14, 54, 6, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 14,
-        54, 6, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 12, 13, 14, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 23, 24,
-        25, 54, 6, 54, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 12, 13, 14, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        24, 25, 54, 6, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 12, 13, 14, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 25, 54, 6, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 11, 12, 13, 14, 54,
-        54, 54, 54, 54, 54, 20, 21, 22,
-        54, 23, 24, 25, 54, 6, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 54, 11, 12, 13, 14,
-        54, 54, 54, 54, 54, 54, 54, 21,
-        22, 54, 23, 24, 25, 54, 6, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 11, 12, 13,
-        14, 54, 54, 54, 54, 54, 54, 54,
-        54, 22, 54, 23, 24, 25, 54, 6,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 10, 11, 12,
-        13, 14, 54, 16, 10, 54, 54, 54,
-        20, 21, 22, 54, 23, 24, 25, 54,
-        6, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 10, 11,
-        12, 13, 14, 54, 54, 10, 54, 54,
-        54, 20, 21, 22, 54, 23, 24, 25,
-        54, 6, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 54, 54, 54, 54, 10,
-        11, 12, 13, 14, 15, 16, 10, 54,
-        54, 54, 20, 21, 22, 54, 23, 24,
-        25, 54, 6, 54, 54, 1, 55, 54,
-        54, 54, 54, 54, 54, 54, 54, 54,
-        10, 11, 12, 13, 14, 15, 16, 10,
-        17, 54, 19, 20, 21, 22, 54, 23,
-        24, 25, 54, 1, 57, 3, 54, 54,
-        54, 3, 54, 54, 6, 54, 54, 1,
-        55, 54, 54, 54, 54, 54, 54, 54,
-        54, 54, 10, 11, 12, 13, 14, 15,
-        16, 10, 17, 18, 19, 20, 21, 22,
-        54, 23, 24, 25, 54, 6, 54, 54,
-        1, 55, 54, 54, 54, 54, 54, 54,
-        54, 54, 54, 10, 11, 12, 13, 14,
-        15, 16, 10, 17, 18, 19, 20, 21,
-        22, 54, 23, 24, 25, 54, 59, 58,
-        58, 58, 58, 58, 58, 58, 58, 58,
-        58, 58, 58, 58, 58, 58, 58, 58,
-        58, 58, 59, 60, 58, 59, 60, 58,
+        1, 0, 2, 3, 4, 2, 5, 3, 
+        4, 4, 6, 4, 4, 1, 7, 4, 
+        4, 4, 2, 2, 8, 9, 4, 4, 
+        10, 11, 12, 13, 14, 15, 16, 10, 
+        17, 18, 19, 20, 21, 22, 4, 23, 
+        24, 25, 4, 27, 26, 29, 28, 28, 
+        30, 31, 28, 28, 28, 28, 28, 28, 
+        28, 28, 32, 33, 34, 35, 36, 37, 
+        38, 39, 33, 40, 32, 41, 42, 43, 
+        44, 28, 45, 46, 47, 28, 29, 28, 
+        28, 30, 31, 28, 28, 28, 28, 28, 
+        28, 28, 28, 48, 33, 34, 35, 36, 
+        37, 38, 39, 33, 40, 41, 41, 42, 
+        43, 44, 28, 45, 46, 47, 28, 30, 
+        49, 29, 28, 28, 30, 31, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 33, 
+        34, 35, 36, 37, 38, 39, 33, 40, 
+        41, 41, 42, 43, 44, 28, 45, 46, 
+        47, 28, 29, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        33, 34, 35, 36, 37, 28, 28, 28, 
+        28, 28, 28, 42, 43, 44, 28, 45, 
+        46, 47, 28, 29, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 34, 35, 36, 37, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        45, 46, 47, 28, 29, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 35, 36, 37, 28, 
+        29, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 36, 37, 28, 29, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 37, 28, 
+        29, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        35, 36, 37, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 45, 46, 47, 
+        28, 29, 28, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 35, 36, 37, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 46, 
+        47, 28, 29, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 35, 36, 37, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 47, 28, 29, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 34, 35, 36, 37, 28, 28, 
+        28, 28, 28, 28, 42, 43, 44, 28, 
+        45, 46, 47, 28, 29, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 28, 34, 35, 36, 37, 28, 
+        28, 28, 28, 28, 28, 28, 43, 44, 
+        28, 45, 46, 47, 28, 29, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 34, 35, 36, 37, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        44, 28, 45, 46, 47, 28, 29, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 33, 34, 35, 36, 
+        37, 28, 39, 33, 28, 28, 28, 42, 
+        43, 44, 28, 45, 46, 47, 28, 29, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 33, 34, 35, 
+        36, 37, 28, 28, 33, 28, 28, 28, 
+        42, 43, 44, 28, 45, 46, 47, 28, 
+        29, 28, 28, 28, 28, 28, 28, 28, 
+        28, 28, 28, 28, 28, 28, 33, 34, 
+        35, 36, 37, 38, 39, 33, 28, 28, 
+        28, 42, 43, 44, 28, 45, 46, 47, 
+        28, 29, 28, 28, 30, 31, 28, 28, 
+        28, 28, 28, 28, 28, 28, 28, 33, 
+        34, 35, 36, 37, 38, 39, 33, 40, 
+        28, 41, 42, 43, 44, 28, 45, 46, 
+        47, 28, 29, 28, 28, 30, 31, 28, 
+        28, 28, 28, 28, 28, 28, 28, 28, 
+        33, 34, 35, 36, 37, 38, 39, 33, 
+        40, 32, 41, 42, 43, 44, 28, 45, 
+        46, 47, 28, 51, 50, 50, 50, 50, 
+        50, 50, 50, 52, 50, 5, 53, 51, 
+        50, 6, 54, 54, 1, 55, 54, 54, 
+        54, 54, 54, 54, 54, 54, 56, 10, 
+        11, 12, 13, 14, 15, 16, 10, 17, 
+        19, 19, 20, 21, 22, 54, 23, 24, 
+        25, 54, 6, 54, 54, 1, 55, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        10, 11, 12, 13, 14, 15, 16, 10, 
+        17, 19, 19, 20, 21, 22, 54, 23, 
+        24, 25, 54, 6, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 10, 11, 12, 13, 14, 54, 54, 
+        54, 54, 54, 54, 20, 21, 22, 54, 
+        23, 24, 25, 54, 6, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 11, 12, 13, 14, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 23, 24, 25, 54, 6, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 12, 13, 14, 
+        54, 6, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 13, 14, 54, 6, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 14, 
+        54, 6, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 12, 13, 14, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 23, 24, 
+        25, 54, 6, 54, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 12, 13, 14, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        24, 25, 54, 6, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 12, 13, 14, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 25, 54, 6, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 11, 12, 13, 14, 54, 
+        54, 54, 54, 54, 54, 20, 21, 22, 
+        54, 23, 24, 25, 54, 6, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 54, 11, 12, 13, 14, 
+        54, 54, 54, 54, 54, 54, 54, 21, 
+        22, 54, 23, 24, 25, 54, 6, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 11, 12, 13, 
+        14, 54, 54, 54, 54, 54, 54, 54, 
+        54, 22, 54, 23, 24, 25, 54, 6, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 10, 11, 12, 
+        13, 14, 54, 16, 10, 54, 54, 54, 
+        20, 21, 22, 54, 23, 24, 25, 54, 
+        6, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 10, 11, 
+        12, 13, 14, 54, 54, 10, 54, 54, 
+        54, 20, 21, 22, 54, 23, 24, 25, 
+        54, 6, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 54, 54, 54, 54, 10, 
+        11, 12, 13, 14, 15, 16, 10, 54, 
+        54, 54, 20, 21, 22, 54, 23, 24, 
+        25, 54, 6, 54, 54, 1, 55, 54, 
+        54, 54, 54, 54, 54, 54, 54, 54, 
+        10, 11, 12, 13, 14, 15, 16, 10, 
+        17, 54, 19, 20, 21, 22, 54, 23, 
+        24, 25, 54, 1, 57, 3, 54, 54, 
+        54, 3, 54, 54, 6, 54, 54, 1, 
+        55, 54, 54, 54, 54, 54, 54, 54, 
+        54, 54, 10, 11, 12, 13, 14, 15, 
+        16, 10, 17, 18, 19, 20, 21, 22, 
+        54, 23, 24, 25, 54, 6, 54, 54, 
+        1, 55, 54, 54, 54, 54, 54, 54, 
+        54, 54, 54, 10, 11, 12, 13, 14, 
+        15, 16, 10, 17, 18, 19, 20, 21, 
+        22, 54, 23, 24, 25, 54, 59, 58, 
+        58, 58, 58, 58, 58, 58, 58, 58, 
+        58, 58, 58, 58, 58, 58, 58, 58, 
+        58, 58, 59, 60, 58, 59, 60, 58, 
         60, 58, 0
 };
 
 static const char _use_syllable_machine_trans_targs[] = {
-        1, 26, 2, 3, 1, 23, 1, 43,
-        44, 46, 28, 29, 30, 31, 32, 39,
-        40, 41, 45, 42, 36, 37, 38, 33,
-        34, 35, 1, 1, 1, 1, 4, 5,
-        22, 7, 8, 9, 10, 11, 18, 19,
-        20, 21, 15, 16, 17, 12, 13, 14,
-        6, 1, 1, 24, 25, 1, 1, 0,
+        1, 26, 2, 3, 1, 23, 1, 43, 
+        44, 46, 28, 29, 30, 31, 32, 39, 
+        40, 41, 45, 42, 36, 37, 38, 33, 
+        34, 35, 1, 1, 1, 1, 4, 5, 
+        22, 7, 8, 9, 10, 11, 18, 19, 
+        20, 21, 15, 16, 17, 12, 13, 14, 
+        6, 1, 1, 24, 25, 1, 1, 0, 
         27, 1, 1, 47, 48
 };
 
 static const char _use_syllable_machine_trans_actions[] = {
-        1, 2, 0, 0, 5, 0, 6, 0,
-        2, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 2, 2, 0, 0, 0, 0,
-        0, 0, 7, 8, 9, 10, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 11, 12, 0, 0, 13, 14, 0,
+        1, 2, 0, 0, 5, 0, 6, 0, 
+        2, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 2, 2, 0, 0, 0, 0, 
+        0, 0, 7, 8, 9, 10, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 11, 12, 0, 0, 13, 14, 0, 
         2, 15, 16, 0, 0
 };
 
 static const char _use_syllable_machine_to_state_actions[] = {
-        0, 3, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
+        0, 3, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
         0
 };
 
 static const char _use_syllable_machine_from_state_actions[] = {
-        0, 4, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
+        0, 4, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
+        0, 0, 0, 0, 0, 0, 0, 0, 
         0
 };
 
 static const short _use_syllable_machine_eof_trans[] = {
-        1, 0, 27, 29, 29, 50, 29, 29,
-        29, 29, 29, 29, 29, 29, 29, 29,
-        29, 29, 29, 29, 29, 29, 29, 51,
-        54, 51, 55, 55, 55, 55, 55, 55,
-        55, 55, 55, 55, 55, 55, 55, 55,
-        55, 55, 55, 58, 55, 55, 59, 59,
+        1, 0, 27, 29, 29, 50, 29, 29, 
+        29, 29, 29, 29, 29, 29, 29, 29, 
+        29, 29, 29, 29, 29, 29, 29, 51, 
+        54, 51, 55, 55, 55, 55, 55, 55, 
+        55, 55, 55, 55, 55, 55, 55, 55, 
+        55, 55, 55, 58, 55, 55, 59, 59, 
         59
 };
 
@@ -310,7 +310,7 @@
   unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED;
   int cs;
   hb_glyph_info_t *info = buffer->info;
-
+  
 #line 315 "hb-ot-shape-complex-use-machine.hh"
         {
         cs = use_syllable_machine_start;
@@ -327,7 +327,7 @@
 
   unsigned int last = 0;
   unsigned int syllable_serial = 1;
-
+  
 #line 332 "hb-ot-shape-complex-use-machine.hh"
         {
         int _slen;
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -559,6 +559,47 @@
 }
 
 static bool
+decompose_use (const hb_ot_shape_normalize_context_t *c,
+                hb_codepoint_t  ab,
+                hb_codepoint_t *a,
+                hb_codepoint_t *b)
+{
+  switch (ab)
+  {
+    /* Chakma:
+     * Special case where the Unicode decomp gives matras in the wrong order
+     * for cluster validation.
+     */
+    case 0x1112Eu : *a = 0x11127u; *b= 0x11131u; return true;
+    case 0x1112Fu : *a = 0x11127u; *b= 0x11132u; return true;
+
+    /*
+     * Decompose split matras that don't have Unicode decompositions.
+     */
+
+    /* Limbu */
+    case 0x1925u  : *a = 0x1920u; *b= 0x1923u; return true;
+    case 0x1926u  : *a = 0x1920u; *b= 0x1924u; return true;
+
+    /* Balinese */
+    case 0x1B3Cu  : *a = 0x1B42u; *b= 0x1B3Cu; return true;
+
+#if 0
+    /* Lepcha */
+    case 0x1C29u  : *a = no decomp, -> LEFT; return true;
+
+    /* Javanese */
+    case 0xA9C0u  : *a = no decomp, -> RIGHT; return true;
+
+    /* Sharada */
+    case 0x111BFu  : *a = no decomp, -> ABOVE; return true;
+#endif
+  }
+
+  return (bool) c->unicode->decompose (ab, a, b);
+}
+
+static bool
 compose_use (const hb_ot_shape_normalize_context_t *c,
              hb_codepoint_t  a,
              hb_codepoint_t  b,
@@ -582,9 +623,10 @@
   NULL, /* preprocess_text */
   NULL, /* postprocess_glyphs */
   HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
-  NULL, /* decompose */
+  decompose_use,
   compose_use,
   setup_masks_use,
+  NULL, /* disable_otl */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
   false, /* fallback_position */
 };
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -77,11 +77,13 @@
                          map (face, &props) {}
   ~hb_ot_shape_planner_t (void) { map.finish (); }
 
-  inline void compile (hb_ot_shape_plan_t &plan)
+  inline void compile (hb_ot_shape_plan_t &plan,
+                       const int          *coords,
+                       unsigned int        num_coords)
   {
     plan.props = props;
     plan.shaper = shaper;
-    map.compile (plan.map);
+    map.compile (plan.map, coords, num_coords);
 
     plan.rtlm_mask = plan.map.get_1_mask (HB_TAG ('r','t','l','m'));
     plan.frac_mask = plan.map.get_1_mask (HB_TAG ('f','r','a','c'));
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -69,6 +69,9 @@
 {
   hb_ot_map_builder_t *map = &planner->map;
 
+  map->add_global_bool_feature (HB_TAG('r','v','r','n'));
+  map->add_gsub_pause (NULL);
+
   switch (props->direction) {
     case HB_DIRECTION_LTR:
       map->add_global_bool_feature (HB_TAG ('l','t','r','a'));
@@ -163,7 +166,9 @@
 hb_ot_shaper_shape_plan_data_t *
 _hb_ot_shaper_shape_plan_data_create (hb_shape_plan_t    *shape_plan,
                                       const hb_feature_t *user_features,
-                                      unsigned int        num_user_features)
+                                      unsigned int        num_user_features,
+                                      const int          *coords,
+                                      unsigned int        num_coords)
 {
   hb_ot_shape_plan_t *plan = (hb_ot_shape_plan_t *) calloc (1, sizeof (hb_ot_shape_plan_t));
   if (unlikely (!plan))
@@ -173,9 +178,10 @@
 
   planner.shaper = hb_ot_shape_complex_categorize (&planner);
 
-  hb_ot_shape_collect_features (&planner, &shape_plan->props, user_features, num_user_features);
+  hb_ot_shape_collect_features (&planner, &shape_plan->props,
+                                user_features, num_user_features);
 
-  planner.compile (*plan);
+  planner.compile (*plan, coords, num_coords);
 
   if (plan->shaper->data_create) {
     plan->data = plan->shaper->data_create (plan);
@@ -212,6 +218,8 @@
   unsigned int        num_user_features;
 
   /* Transient stuff */
+  bool fallback_positioning;
+  bool fallback_glyph_classes;
   hb_direction_t target_direction;
 };
 
@@ -524,6 +532,32 @@
 }
 
 static inline void
+hb_synthesize_glyph_classes (hb_ot_shape_context_t *c)
+{
+  unsigned int count = c->buffer->len;
+  hb_glyph_info_t *info = c->buffer->info;
+  for (unsigned int i = 0; i < count; i++)
+  {
+    hb_ot_layout_glyph_props_flags_t klass;
+
+    /* Never mark default-ignorables as marks.
+     * They won't get in the way of lookups anyway,
+     * but having them as mark will cause them to be skipped
+     * over if the lookup-flag says so, but at least for the
+     * Mongolian variation selectors, looks like Uniscribe
+     * marks them as non-mark.  Some Mongolian fonts without
+     * GDEF rely on this.  Another notable character that
+     * this applies to is COMBINING GRAPHEME JOINER. */
+    klass = (_hb_glyph_info_get_general_category (&info[i]) !=
+             HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK ||
+             _hb_glyph_info_is_default_ignorable (&info[i])) ?
+            HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH :
+            HB_OT_LAYOUT_GLYPH_PROPS_MARK;
+    _hb_glyph_info_set_glyph_props (&info[i], klass);
+  }
+}
+
+static inline void
 hb_ot_substitute_default (hb_ot_shape_context_t *c)
 {
   hb_buffer_t *buffer = c->buffer;
@@ -539,7 +573,7 @@
   hb_ot_shape_setup_masks (c);
 
   /* This is unfortunate to go here, but necessary... */
-  if (!hb_ot_layout_has_positioning (c->face))
+  if (c->fallback_positioning)
     _hb_ot_shape_fallback_position_recategorize_marks (c->plan, c->font, buffer);
 
   hb_ot_map_glyphs_fast (buffer);
@@ -554,6 +588,9 @@
 
   hb_ot_layout_substitute_start (c->font, buffer);
 
+  if (!hb_ot_layout_has_glyph_classes (c->face))
+    hb_synthesize_glyph_classes (c);
+
   c->plan->substitute (c->font, buffer);
 
   return;
@@ -632,14 +669,12 @@
     _hb_ot_shape_fallback_spaces (c->plan, c->font, c->buffer);
 }
 
-static inline bool
+static inline void
 hb_ot_position_complex (hb_ot_shape_context_t *c)
 {
   hb_ot_layout_position_start (c->font, c->buffer);
 
-  bool ret = false;
   unsigned int count = c->buffer->len;
-  bool has_positioning = (bool) hb_ot_layout_has_positioning (c->face);
 
   /* If the font has no GPOS, AND, no fallback positioning will
    * happen, AND, direction is forward, then when zeroing mark
@@ -650,8 +685,9 @@
    * If fallback positinoing happens or GPOS is present, we don't
    * care.
    */
-  bool adjust_offsets_when_zeroing = !(has_positioning || c->plan->shaper->fallback_position ||
-                                       HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction));
+  bool adjust_offsets_when_zeroing = c->fallback_positioning &&
+                                     !c->plan->shaper->fallback_position &&
+                                     HB_DIRECTION_IS_FORWARD (c->buffer->props.direction);
 
   switch (c->plan->shaper->zero_width_marks)
   {
@@ -665,7 +701,7 @@
       break;
   }
 
-  if (has_positioning)
+  if (likely (!c->fallback_positioning))
   {
     hb_glyph_info_t *info = c->buffer->info;
     hb_glyph_position_t *pos = c->buffer->pos;
@@ -688,7 +724,6 @@
                                           &pos[i].x_offset,
                                           &pos[i].y_offset);
 
-    ret = true;
   }
 
   switch (c->plan->shaper->zero_width_marks)
@@ -707,8 +742,6 @@
   hb_ot_layout_position_finish_advances (c->font, c->buffer);
   hb_ot_zero_width_default_ignorables (c);
   hb_ot_layout_position_finish_offsets (c->font, c->buffer);
-
-  return ret;
 }
 
 static inline void
@@ -718,9 +751,9 @@
 
   hb_ot_position_default (c);
 
-  hb_bool_t fallback = !hb_ot_position_complex (c);
+  hb_ot_position_complex (c);
 
-  if (fallback && c->plan->shaper->fallback_position)
+  if (c->fallback_positioning && c->plan->shaper->fallback_position)
     _hb_ot_shape_fallback_position (c->plan, c->font, c->buffer);
 
   if (HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction))
@@ -728,7 +761,7 @@
 
   /* Visual fallback goes here. */
 
-  if (fallback)
+  if (c->fallback_positioning)
     _hb_ot_shape_fallback_kern (c->plan, c->font, c->buffer);
 
   _hb_buffer_deallocate_gsubgpos_vars (c->buffer);
@@ -748,6 +781,11 @@
                               (unsigned) HB_BUFFER_MAX_LEN_MIN);
   }
 
+  bool disable_otl = c->plan->shaper->disable_otl && c->plan->shaper->disable_otl (c->plan);
+  //c->fallback_substitute     = disable_otl || !hb_ot_layout_has_substitution (c->face);
+  c->fallback_positioning    = disable_otl || !hb_ot_layout_has_positioning (c->face);
+  c->fallback_glyph_classes  = disable_otl || !hb_ot_layout_has_glyph_classes (c->face);
+
   /* Save the original direction, we use it later. */
   c->target_direction = c->buffer->props.direction;
 
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-tag.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-tag.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -826,16 +826,19 @@
 };
 
 typedef struct {
-  char language[8];
+  char language[11];
   hb_tag_t tag;
 } LangTagLong;
 static const LangTagLong ot_languages_zh[] = {
+  /* Store longest-first, if one is a prefix of another. */
   {"zh-cn",     HB_TAG('Z','H','S',' ')},       /* Chinese (China) */
   {"zh-hk",     HB_TAG('Z','H','H',' ')},       /* Chinese (Hong Kong) */
-  {"zh-mo",     HB_TAG('Z','H','T',' ')},       /* Chinese (Macao) */
+  {"zh-mo",     HB_TAG('Z','H','H',' ')},       /* Chinese (Macao) */
   {"zh-sg",     HB_TAG('Z','H','S',' ')},       /* Chinese (Singapore) */
   {"zh-tw",     HB_TAG('Z','H','T',' ')},       /* Chinese (Taiwan) */
   {"zh-hans",   HB_TAG('Z','H','S',' ')},       /* Chinese (Simplified) */
+  {"zh-hant-hk",HB_TAG('Z','H','H',' ')},       /* Chinese (Hong Kong) */
+  {"zh-hant-mo",HB_TAG('Z','H','H',' ')},       /* Chinese (Macao) */
   {"zh-hant",   HB_TAG('Z','H','T',' ')},       /* Chinese (Traditional) */
 };
 
@@ -889,13 +892,21 @@
   }
 
   /*
-   * The International Phonetic Alphabet is a variant tag in BCP-47,
-   * which can be applied to any language.
+   * "fonipa" is a variant tag in BCP-47, meaning the International Phonetic Alphabet.
+   * It can be applied to any language.
    */
   if (strstr (lang_str, "-fonipa")) {
     return HB_TAG('I','P','P','H');  /* Phonetic transcription—IPA conventions */
   }
 
+  /*
+   * "fonnapa" is a variant tag in BCP-47, meaning the North American Phonetic Alphabet
+   * also known as Americanist Phonetic Notation.  It can be applied to any language.
+   */
+  if (strstr (lang_str, "-fonnapa")) {
+    return HB_TAG('A','P','P','H');  /* Phonetic transcription—Americanist conventions */
+  }
+
   /* Find a language matching in the first component */
   {
     const LangTag *lang_tag;
@@ -937,7 +948,7 @@
 /**
  * hb_ot_tag_to_language:
  *
- *
+ * 
  *
  * Return value: (transfer none):
  *
@@ -967,6 +978,8 @@
 
   /* struct LangTag has only room for 3-letter language tags. */
   switch (tag) {
+  case HB_TAG('A','P','P','H'):  /* Phonetic transcription—Americanist conventions */
+    return hb_language_from_string ("und-fonnapa", -1);
   case HB_TAG('I','P','P','H'):  /* Phonetic transcription—IPA conventions */
     return hb_language_from_string ("und-fonipa", -1);
   }
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot.h	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot.h	Sat Jan 21 03:53:21 2017 +0000
@@ -32,6 +32,7 @@
 
 #include "hb-ot-font.h"
 #include "hb-ot-layout.h"
+#include "hb-ot-math.h"
 #include "hb-ot-tag.h"
 #include "hb-ot-shape.h"
 
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -689,17 +689,20 @@
     fprintf (stderr, " %*s  ", (unsigned int) (2 * sizeof (void *)), "");
 
   if (indented) {
-/* One may want to add ASCII version of these.  See:
- * https://bugs.freedesktop.org/show_bug.cgi?id=50970 */
 #define VBAR    "\342\224\202"  /* U+2502 BOX DRAWINGS LIGHT VERTICAL */
 #define VRBAR   "\342\224\234"  /* U+251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT */
 #define DLBAR   "\342\225\256"  /* U+256E BOX DRAWINGS LIGHT ARC DOWN AND LEFT */
 #define ULBAR   "\342\225\257"  /* U+256F BOX DRAWINGS LIGHT ARC UP AND LEFT */
 #define LBAR    "\342\225\264"  /* U+2574 BOX DRAWINGS LIGHT LEFT */
-    static const char bars[] = VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR;
+    static const char bars[] =
+      VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR
+      VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR
+      VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR
+      VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR
+      VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR;
     fprintf (stderr, "%2u %s" VRBAR "%s",
              level,
-             bars + sizeof (bars) - 1 - MIN ((unsigned int) sizeof (bars), (unsigned int) (sizeof (VBAR) - 1) * level),
+             bars + sizeof (bars) - 1 - MIN ((unsigned int) sizeof (bars) - 1, (unsigned int) (sizeof (VBAR) - 1) * level),
              level_dir ? (level_dir > 0 ? DLBAR : ULBAR) : LBAR);
   } else
     fprintf (stderr, "   " VRBAR LBAR);
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -313,7 +313,7 @@
     for (unsigned int i = 0; i < ELTS; i++)
       if (elts[i])
         for (unsigned int j = 0; j < BITS; j++)
-          if (elts[i] & (1 << j))
+          if (elts[i] & (1u << j))
             return i * BITS + j;
     return INVALID;
   }
@@ -322,7 +322,7 @@
     for (unsigned int i = ELTS; i; i--)
       if (elts[i - 1])
         for (unsigned int j = BITS; j; j--)
-          if (elts[i - 1] & (1 << (j - 1)))
+          if (elts[i - 1] & (1u << (j - 1)))
             return (i - 1) * BITS + (j - 1);
     return INVALID;
   }
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -143,9 +143,9 @@
  * hb_set_allocation_successful:
  * @set: a set.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -159,7 +159,7 @@
  * hb_set_clear:
  * @set: a set.
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -173,9 +173,9 @@
  * hb_set_is_empty:
  * @set: a set.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.7
  **/
@@ -188,11 +188,11 @@
 /**
  * hb_set_has:
  * @set: a set.
- * @codepoint:
- *
+ * @codepoint: 
  *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -206,9 +206,9 @@
 /**
  * hb_set_add:
  * @set: a set.
- * @codepoint:
+ * @codepoint: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -222,10 +222,10 @@
 /**
  * hb_set_add_range:
  * @set: a set.
- * @first:
- * @last:
+ * @first: 
+ * @last: 
  *
- *
+ * 
  *
  * Since: 0.9.7
  **/
@@ -240,9 +240,9 @@
 /**
  * hb_set_del:
  * @set: a set.
- * @codepoint:
+ * @codepoint: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -256,10 +256,10 @@
 /**
  * hb_set_del_range:
  * @set: a set.
- * @first:
- * @last:
+ * @first: 
+ * @last: 
  *
- *
+ * 
  *
  * Since: 0.9.7
  **/
@@ -274,11 +274,11 @@
 /**
  * hb_set_is_equal:
  * @set: a set.
- * @other:
- *
+ * @other: 
  *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.7
  **/
@@ -292,9 +292,9 @@
 /**
  * hb_set_set:
  * @set: a set.
- * @other:
+ * @other: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -308,9 +308,9 @@
 /**
  * hb_set_union:
  * @set: a set.
- * @other:
+ * @other: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -324,9 +324,9 @@
 /**
  * hb_set_intersect:
  * @set: a set.
- * @other:
+ * @other: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -340,9 +340,9 @@
 /**
  * hb_set_subtract:
  * @set: a set.
- * @other:
+ * @other: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -356,9 +356,9 @@
 /**
  * hb_set_symmetric_difference:
  * @set: a set.
- * @other:
+ * @other: 
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -373,7 +373,7 @@
  * hb_set_invert:
  * @set: a set.
  *
- *
+ * 
  *
  * Since: 0.9.10
  **/
@@ -436,7 +436,7 @@
  * @set: a set.
  * @codepoint: (inout):
  *
- *
+ * 
  *
  * Return value: whether there was a next value.
  *
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape-plan-private.hh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape-plan-private.hh	Sat Jan 21 03:53:21 2017 +0000
@@ -47,12 +47,17 @@
   hb_feature_t *user_features;
   unsigned int num_user_features;
 
+  int *coords;
+  unsigned int num_coords;
+
   struct hb_shaper_data_t shaper_data;
 };
 
 #define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS \
-        , const hb_feature_t            *user_features \
-        , unsigned int                   num_user_features
+        , const hb_feature_t *user_features \
+        , unsigned int        num_user_features \
+        , const int          *coords \
+        , unsigned int        num_coords
 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, shape_plan);
 #include "hb-shaper-list.hh"
 #undef HB_SHAPER_IMPLEMENT
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape-plan.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape-plan.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -46,11 +46,14 @@
 hb_shape_plan_plan (hb_shape_plan_t    *shape_plan,
                     const hb_feature_t *user_features,
                     unsigned int        num_user_features,
+                    const int          *coords,
+                    unsigned int        num_coords,
                     const char * const *shaper_list)
 {
   DEBUG_MSG_FUNC (SHAPE_PLAN, shape_plan,
-                  "num_features=%d shaper_list=%p",
+                  "num_features=%d num_coords=%d shaper_list=%p",
                   num_user_features,
+                  num_coords,
                   shaper_list);
 
   const hb_shaper_pair_t *shapers = _hb_shapers_get ();
@@ -59,7 +62,9 @@
         HB_STMT_START { \
           if (hb_##shaper##_shaper_face_data_ensure (shape_plan->face_unsafe)) { \
             HB_SHAPER_DATA (shaper, shape_plan) = \
-              HB_SHAPER_DATA_CREATE_FUNC (shaper, shape_plan) (shape_plan, user_features, num_user_features); \
+              HB_SHAPER_DATA_CREATE_FUNC (shaper, shape_plan) (shape_plan, \
+                                                               user_features, num_user_features, \
+                                                               coords, num_coords); \
             shape_plan->shaper_func = _hb_##shaper##_shape; \
             shape_plan->shaper_name = #shaper; \
             return; \
@@ -96,13 +101,13 @@
 
 /**
  * hb_shape_plan_create: (Xconstructor)
- * @face:
- * @props:
+ * @face: 
+ * @props: 
  * @user_features: (array length=num_user_features):
- * @num_user_features:
+ * @num_user_features: 
  * @shaper_list: (array zero-terminated=1):
  *
- *
+ * 
  *
  * Return value: (transfer full):
  *
@@ -115,14 +120,31 @@
                       unsigned int                   num_user_features,
                       const char * const            *shaper_list)
 {
+  return hb_shape_plan_create2 (face, props,
+                                user_features, num_user_features,
+                                NULL, 0,
+                                shaper_list);
+}
+
+hb_shape_plan_t *
+hb_shape_plan_create2 (hb_face_t                     *face,
+                       const hb_segment_properties_t *props,
+                       const hb_feature_t            *user_features,
+                       unsigned int                   num_user_features,
+                       const int                     *orig_coords,
+                       unsigned int                   num_coords,
+                       const char * const            *shaper_list)
+{
   DEBUG_MSG_FUNC (SHAPE_PLAN, NULL,
-                  "face=%p num_features=%d shaper_list=%p",
+                  "face=%p num_features=%d num_coords=%d shaper_list=%p",
                   face,
                   num_user_features,
+                  num_coords,
                   shaper_list);
 
   hb_shape_plan_t *shape_plan;
   hb_feature_t *features = NULL;
+  int *coords = NULL;
 
   if (unlikely (!face))
     face = hb_face_get_empty ();
@@ -130,7 +152,14 @@
     return hb_shape_plan_get_empty ();
   if (num_user_features && !(features = (hb_feature_t *) calloc (num_user_features, sizeof (hb_feature_t))))
     return hb_shape_plan_get_empty ();
-  if (!(shape_plan = hb_object_create<hb_shape_plan_t> ())) {
+  if (num_coords && !(coords = (int *) calloc (num_coords, sizeof (int))))
+  {
+    free (features);
+    return hb_shape_plan_get_empty ();
+  }
+  if (!(shape_plan = hb_object_create<hb_shape_plan_t> ()))
+  {
+    free (coords);
     free (features);
     return hb_shape_plan_get_empty ();
   }
@@ -145,8 +174,15 @@
   shape_plan->user_features = features;
   if (num_user_features)
     memcpy (features, user_features, num_user_features * sizeof (hb_feature_t));
+  shape_plan->num_coords = num_coords;
+  shape_plan->coords = coords;
+  if (num_coords)
+    memcpy (coords, orig_coords, num_coords * sizeof (int));
 
-  hb_shape_plan_plan (shape_plan, user_features, num_user_features, shaper_list);
+  hb_shape_plan_plan (shape_plan,
+                      user_features, num_user_features,
+                      coords, num_coords,
+                      shaper_list);
 
   return shape_plan;
 }
@@ -154,7 +190,7 @@
 /**
  * hb_shape_plan_get_empty:
  *
- *
+ * 
  *
  * Return value: (transfer full):
  *
@@ -176,6 +212,9 @@
     NULL, /* user_features */
     0,    /* num_user_featurs */
 
+    NULL, /* coords */
+    0,    /* num_coords */
+
     {
 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID,
 #include "hb-shaper-list.hh"
@@ -190,7 +229,7 @@
  * hb_shape_plan_reference: (skip)
  * @shape_plan: a shape plan.
  *
- *
+ * 
  *
  * Return value: (transfer full):
  *
@@ -206,7 +245,7 @@
  * hb_shape_plan_destroy: (skip)
  * @shape_plan: a shape plan.
  *
- *
+ * 
  *
  * Since: 0.9.7
  **/
@@ -220,6 +259,7 @@
 #undef HB_SHAPER_IMPLEMENT
 
   free (shape_plan->user_features);
+  free (shape_plan->coords);
 
   free (shape_plan);
 }
@@ -227,14 +267,14 @@
 /**
  * hb_shape_plan_set_user_data: (skip)
  * @shape_plan: a shape plan.
- * @key:
- * @data:
- * @destroy:
- * @replace:
+ * @key: 
+ * @data: 
+ * @destroy: 
+ * @replace: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.7
  **/
@@ -251,9 +291,9 @@
 /**
  * hb_shape_plan_get_user_data: (skip)
  * @shape_plan: a shape plan.
- * @key:
+ * @key: 
  *
- *
+ * 
  *
  * Return value: (transfer none):
  *
@@ -273,11 +313,11 @@
  * @font: a font.
  * @buffer: a buffer.
  * @features: (array length=num_features):
- * @num_features:
- *
+ * @num_features: 
  *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.7
  **/
@@ -289,9 +329,10 @@
                        unsigned int        num_features)
 {
   DEBUG_MSG_FUNC (SHAPE_PLAN, shape_plan,
-                  "num_features=%d shaper_func=%p",
+                  "num_features=%d shaper_func=%p, shaper_name=%s",
                   num_features,
-                  shape_plan->shaper_func);
+                  shape_plan->shaper_func,
+                  shape_plan->shaper_name);
 
   if (unlikely (!buffer->len))
     return true;
@@ -350,6 +391,8 @@
   const char * const            *shaper_list;
   const hb_feature_t            *user_features;
   unsigned int                   num_user_features;
+  const int                     *coords;
+  unsigned int                   num_coords;
   hb_shape_func_t               *shaper_func;
 };
 
@@ -357,12 +400,26 @@
 hb_shape_plan_user_features_match (const hb_shape_plan_t          *shape_plan,
                                    const hb_shape_plan_proposal_t *proposal)
 {
-  if (proposal->num_user_features != shape_plan->num_user_features) return false;
+  if (proposal->num_user_features != shape_plan->num_user_features)
+    return false;
   for (unsigned int i = 0, n = proposal->num_user_features; i < n; i++)
     if (proposal->user_features[i].tag   != shape_plan->user_features[i].tag   ||
         proposal->user_features[i].value != shape_plan->user_features[i].value ||
         proposal->user_features[i].start != shape_plan->user_features[i].start ||
-        proposal->user_features[i].end   != shape_plan->user_features[i].end) return false;
+        proposal->user_features[i].end   != shape_plan->user_features[i].end)
+      return false;
+  return true;
+}
+
+static inline hb_bool_t
+hb_shape_plan_coords_match (const hb_shape_plan_t          *shape_plan,
+                            const hb_shape_plan_proposal_t *proposal)
+{
+  if (proposal->num_coords != shape_plan->num_coords)
+    return false;
+  for (unsigned int i = 0, n = proposal->num_coords; i < n; i++)
+    if (proposal->coords[i] != shape_plan->coords[i])
+      return false;
   return true;
 }
 
@@ -372,6 +429,7 @@
 {
   return hb_segment_properties_equal (&shape_plan->props, &proposal->props) &&
          hb_shape_plan_user_features_match (shape_plan, proposal) &&
+         hb_shape_plan_coords_match (shape_plan, proposal) &&
          ((shape_plan->default_shaper_list && proposal->shaper_list == NULL) ||
           (shape_plan->shaper_func == proposal->shaper_func));
 }
@@ -388,15 +446,22 @@
   return false;
 }
 
+static inline hb_bool_t
+hb_coords_present (const int *coords,
+                   unsigned int num_coords)
+{
+  return num_coords != 0;
+}
+
 /**
  * hb_shape_plan_create_cached:
- * @face:
- * @props:
+ * @face: 
+ * @props: 
  * @user_features: (array length=num_user_features):
- * @num_user_features:
+ * @num_user_features: 
  * @shaper_list: (array zero-terminated=1):
  *
- *
+ * 
  *
  * Return value: (transfer full):
  *
@@ -409,6 +474,21 @@
                              unsigned int                   num_user_features,
                              const char * const            *shaper_list)
 {
+  return hb_shape_plan_create_cached2 (face, props,
+                                       user_features, num_user_features,
+                                       NULL, 0,
+                                       shaper_list);
+}
+
+hb_shape_plan_t *
+hb_shape_plan_create_cached2 (hb_face_t                     *face,
+                              const hb_segment_properties_t *props,
+                              const hb_feature_t            *user_features,
+                              unsigned int                   num_user_features,
+                              const int                     *coords,
+                              unsigned int                   num_coords,
+                              const char * const            *shaper_list)
+{
   DEBUG_MSG_FUNC (SHAPE_PLAN, NULL,
                   "face=%p num_features=%d shaper_list=%p",
                   face,
@@ -455,16 +535,21 @@
 
   /* Not found. */
 
-  hb_shape_plan_t *shape_plan = hb_shape_plan_create (face, props, user_features, num_user_features, shaper_list);
+  hb_shape_plan_t *shape_plan = hb_shape_plan_create2 (face, props,
+                                                       user_features, num_user_features,
+                                                       coords, num_coords,
+                                                       shaper_list);
 
   /* Don't add to the cache if face is inert. */
   if (unlikely (hb_object_is_inert (face)))
     return shape_plan;
 
   /* Don't add the plan to the cache if there were user features with non-global ranges */
-
   if (hb_non_global_user_features_present (user_features, num_user_features))
     return shape_plan;
+  /* Don't add the plan to the cache if there were variation coordinates XXX Fix me. */
+  if (hb_coords_present (coords, num_coords))
+    return shape_plan;
 
   hb_face_t::plan_node_t *node = (hb_face_t::plan_node_t *) calloc (1, sizeof (hb_face_t::plan_node_t));
   if (unlikely (!node))
@@ -487,7 +572,7 @@
  * hb_shape_plan_get_shaper:
  * @shape_plan: a shape plan.
  *
- *
+ * 
  *
  * Return value: (transfer none):
  *
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape-plan.h	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape-plan.h	Sat Jan 21 03:53:21 2017 +0000
@@ -53,6 +53,25 @@
                              const char * const            *shaper_list);
 
 HB_EXTERN hb_shape_plan_t *
+hb_shape_plan_create2 (hb_face_t                     *face,
+                       const hb_segment_properties_t *props,
+                       const hb_feature_t            *user_features,
+                       unsigned int                   num_user_features,
+                       const int                     *coords,
+                       unsigned int                   num_coords,
+                       const char * const            *shaper_list);
+
+HB_EXTERN hb_shape_plan_t *
+hb_shape_plan_create_cached2 (hb_face_t                     *face,
+                              const hb_segment_properties_t *props,
+                              const hb_feature_t            *user_features,
+                              unsigned int                   num_user_features,
+                              const int                     *coords,
+                              unsigned int                   num_coords,
+                              const char * const            *shaper_list);
+
+
+HB_EXTERN hb_shape_plan_t *
 hb_shape_plan_get_empty (void);
 
 HB_EXTERN hb_shape_plan_t *
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -373,7 +373,10 @@
                unsigned int        num_features,
                const char * const *shaper_list)
 {
-  hb_shape_plan_t *shape_plan = hb_shape_plan_create_cached (font->face, &buffer->props, features, num_features, shaper_list);
+  hb_shape_plan_t *shape_plan = hb_shape_plan_create_cached2 (font->face, &buffer->props,
+                                                              features, num_features,
+                                                              font->coords, font->num_coords,
+                                                              shaper_list);
   hb_bool_t res = hb_shape_plan_execute (shape_plan, font, buffer, features, num_features);
   hb_shape_plan_destroy (shape_plan);
 
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -131,12 +131,12 @@
 #define HB_UNICODE_FUNCS_IMPLEMENT(set) \
   return hb_##set##_get_unicode_funcs ();
 
-#ifdef HAVE_GLIB
+#if defined(HAVE_UCDN)
+  HB_UNICODE_FUNCS_IMPLEMENT(ucdn)
+#elif defined(HAVE_GLIB)
   HB_UNICODE_FUNCS_IMPLEMENT(glib)
 #elif defined(HAVE_ICU) && defined(HAVE_ICU_BUILTIN)
   HB_UNICODE_FUNCS_IMPLEMENT(icu)
-#elif defined(HAVE_UCDN)
-  HB_UNICODE_FUNCS_IMPLEMENT(ucdn)
 #else
 #define HB_UNICODE_FUNCS_NIL 1
   HB_UNICODE_FUNCS_IMPLEMENT(nil)
@@ -154,7 +154,7 @@
  * hb_unicode_funcs_create: (Xconstructor)
  * @parent: (nullable):
  *
- *
+ * 
  *
  * Return value: (transfer full):
  *
@@ -200,7 +200,7 @@
 /**
  * hb_unicode_funcs_get_empty:
  *
- *
+ * 
  *
  * Return value: (transfer full):
  *
@@ -216,7 +216,7 @@
  * hb_unicode_funcs_reference: (skip)
  * @ufuncs: Unicode functions.
  *
- *
+ * 
  *
  * Return value: (transfer full):
  *
@@ -232,7 +232,7 @@
  * hb_unicode_funcs_destroy: (skip)
  * @ufuncs: Unicode functions.
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -254,14 +254,14 @@
 /**
  * hb_unicode_funcs_set_user_data: (skip)
  * @ufuncs: Unicode functions.
- * @key:
- * @data:
- * @destroy:
- * @replace:
+ * @key: 
+ * @data: 
+ * @destroy: 
+ * @replace: 
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -278,9 +278,9 @@
 /**
  * hb_unicode_funcs_get_user_data: (skip)
  * @ufuncs: Unicode functions.
- * @key:
+ * @key: 
  *
- *
+ * 
  *
  * Return value: (transfer none):
  *
@@ -298,7 +298,7 @@
  * hb_unicode_funcs_make_immutable:
  * @ufuncs: Unicode functions.
  *
- *
+ * 
  *
  * Since: 0.9.2
  **/
@@ -315,9 +315,9 @@
  * hb_unicode_funcs_is_immutable:
  * @ufuncs: Unicode functions.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -331,9 +331,9 @@
  * hb_unicode_funcs_get_parent:
  * @ufuncs: Unicode functions.
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -387,13 +387,13 @@
 /**
  * hb_unicode_compose:
  * @ufuncs: Unicode functions.
- * @a:
- * @b:
+ * @a: 
+ * @b: 
  * @ab: (out):
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -409,13 +409,13 @@
 /**
  * hb_unicode_decompose:
  * @ufuncs: Unicode functions.
- * @ab:
+ * @ab: 
  * @a: (out):
  * @b: (out):
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
@@ -431,12 +431,12 @@
 /**
  * hb_unicode_decompose_compatibility:
  * @ufuncs: Unicode functions.
- * @u:
+ * @u: 
  * @decomposed: (out):
  *
- *
+ * 
  *
- * Return value:
+ * Return value: 
  *
  * Since: 0.9.2
  **/
--- a/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-version.h	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-version.h	Sat Jan 21 03:53:21 2017 +0000
@@ -37,10 +37,10 @@
 
 
 #define HB_VERSION_MAJOR 1
-#define HB_VERSION_MINOR 3
-#define HB_VERSION_MICRO 0
+#define HB_VERSION_MINOR 4
+#define HB_VERSION_MICRO 1
 
-#define HB_VERSION_STRING "1.3.0"
+#define HB_VERSION_STRING "1.4.1"
 
 #define HB_VERSION_ATLEAST(major,minor,micro) \
         ((major)*10000+(minor)*100+(micro) <= \
--- a/jdk/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc	Sat Jan 21 03:53:21 2017 +0000
@@ -49,7 +49,7 @@
     JNIEnv* env = jdkFontInfo->env;
     jobject font2D = jdkFontInfo->font2D;
     hb_codepoint_t u = (variation_selector==0) ? unicode : variation_selector;
- 
+
     *glyph = (hb_codepoint_t)
           env->CallIntMethod(font2D, sunFontIDs.f2dCharToGlyphMID, u);
     return (*glyph != 0);
@@ -61,7 +61,7 @@
 			   hb_codepoint_t glyph,
 			   void *user_data HB_UNUSED)
 {
-    
+
     float fadv = 0.0f;
     if ((glyph & 0xfffe) == 0xfffe) {
         return 0; // JDK uses this glyph code.
@@ -72,7 +72,7 @@
     jobject fontStrike = jdkFontInfo->fontStrike;
     jobject pt = env->CallObjectMethod(fontStrike,
                                        sunFontIDs.getGlyphMetricsMID, glyph);
-  
+
     if (pt == NULL) {
         return 0;
     }
@@ -89,7 +89,7 @@
 			   hb_codepoint_t glyph,
 			   void *user_data HB_UNUSED)
 {
-  
+
     float fadv = 0.0f;
     if ((glyph & 0xfffe) == 0xfffe) {
         return 0; // JDK uses this glyph code.
@@ -100,7 +100,7 @@
     jobject fontStrike = jdkFontInfo->fontStrike;
     jobject pt = env->CallObjectMethod(fontStrike,
                                        sunFontIDs.getGlyphMetricsMID, glyph);
-  
+
     if (pt == NULL) {
         return 0;
     }
@@ -108,7 +108,7 @@
     env->DeleteLocalRef(pt);
 
     return HBFloatToFixed(fadv);
-  
+
 }
 
 static hb_bool_t
@@ -196,7 +196,7 @@
     jobject pt = env->CallObjectMethod(fontStrike,
                                        sunFontIDs.getGlyphPointMID,
                                        glyph, point_index);
-  
+
     if (pt == NULL) {
         *x = 0; *y = 0;
         return true;
@@ -238,8 +238,8 @@
   hb_font_funcs_t *ff;
 
   if (!jdk_ffuncs) {
-      ff = hb_font_funcs_create(); 
-      
+      ff = hb_font_funcs_create();
+
       hb_font_funcs_set_glyph_func(ff, hb_jdk_get_glyph, NULL, NULL);
       hb_font_funcs_set_glyph_h_advance_func(ff,
                     hb_jdk_get_glyph_h_advance, NULL, NULL);
@@ -278,7 +278,7 @@
   jobject font2D = jdkFontInfo->font2D;
   jsize length;
   jbyte* buffer;
-  
+
   // HB_TAG_NONE is 0 and is used to get the whole font file.
   // It is not expected not be needed for JDK.
   if (tag == 0) {
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuBarPeer.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuBarPeer.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -248,9 +248,11 @@
         XMenuItemPeer.TextMetrics[] itemMetrics = new XMenuItemPeer.TextMetrics[itemCnt];
         for (int i = 0; i < itemCnt; i++) {
             itemMetrics[i] = itemVector[i].getTextMetrics();
-            Dimension dim = itemMetrics[i].getTextDimension();
-            if (dim != null) {
-                maxHeight = Math.max(maxHeight, dim.height);
+            if (itemMetrics[i] != null) {
+                Dimension dim = itemMetrics[i].getTextDimension();
+                if (dim != null) {
+                    maxHeight = Math.max(maxHeight, dim.height);
+                }
             }
         }
         //Calculate bounds
@@ -260,6 +262,9 @@
         for (int i = 0; i < itemCnt; i++) {
             XMenuItemPeer item = itemVector[i];
             XMenuItemPeer.TextMetrics metrics = itemMetrics[i];
+            if (metrics == null) {
+                continue;
+            }
             Dimension dim = metrics.getTextDimension();
             if (dim != null) {
                 int itemWidth = BAR_ITEM_MARGIN_LEFT + dim.width + BAR_ITEM_MARGIN_RIGHT;
@@ -280,9 +285,6 @@
                 Point textOrigin = new Point(nextOffset + BAR_ITEM_MARGIN_LEFT, BAR_SPACING_TOP + BAR_ITEM_MARGIN_TOP + y);
                 nextOffset += itemWidth + BAR_ITEM_SPACING;
                 item.map(bounds, textOrigin);
-            } else {
-                Rectangle bounds = new Rectangle(nextOffset, BAR_SPACING_TOP, 0, 0);
-                Point textOrigin = new Point(nextOffset + BAR_ITEM_MARGIN_LEFT, BAR_SPACING_TOP + BAR_ITEM_MARGIN_TOP);
             }
         }
         XMenuItemPeer mappedVector[] = new XMenuItemPeer[mappedCnt];
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java	Sat Jan 21 03:53:21 2017 +0000
@@ -27,7 +27,7 @@
 import java.awt.*;
 import java.awt.peer.*;
 import java.security.AccessController;
-import java.security.PrivilegedAction;
+import sun.security.action.GetPropertyAction;
 
 import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
@@ -40,11 +40,11 @@
     static final boolean tryGtk;
     static {
         loadNativeLibraries();
-        tryGtk = AccessController.doPrivileged((PrivilegedAction<Boolean>)()
-                -> Boolean.getBoolean("awt.robot.gtk"));
+        tryGtk = Boolean.parseBoolean(
+                            AccessController.doPrivileged(
+                                    new GetPropertyAction("awt.robot.gtk", "true")
+                            ));
     }
-
-    private static boolean isGtkSupported =  false;
     private static volatile boolean useGtk;
     private X11GraphicsConfig   xgc = null;
 
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp	Sat Jan 21 03:53:21 2017 +0000
@@ -99,7 +99,6 @@
 HWND AwtComponent::sm_focusOwner = NULL;
 HWND AwtComponent::sm_focusedWindow = NULL;
 BOOL AwtComponent::sm_bMenuLoop = FALSE;
-AwtComponent* AwtComponent::sm_getComponentCache = NULL;
 BOOL AwtComponent::sm_inSynthesizeFocus = FALSE;
 
 /************************************************************************/
@@ -276,10 +275,6 @@
      * handle.
      */
     DestroyHWnd();
-
-    if (sm_getComponentCache == this) {
-        sm_getComponentCache = NULL;
-    }
 }
 
 void AwtComponent::Dispose()
@@ -352,9 +347,6 @@
     if (hWnd == AwtToolkit::GetInstance().GetHWnd()) {
         return NULL;
     }
-    if (sm_getComponentCache && sm_getComponentCache->GetHWnd() == hWnd) {
-        return sm_getComponentCache;
-    }
 
     // check that it's an AWT component from the same toolkit as the caller
     if (::IsWindow(hWnd) &&
@@ -362,7 +354,7 @@
     {
         DASSERT(WmAwtIsComponent != 0);
         if (::SendMessage(hWnd, WmAwtIsComponent, 0, 0L)) {
-            return sm_getComponentCache = GetComponentImpl(hWnd);
+            return GetComponentImpl(hWnd);
         }
     }
     return NULL;
--- a/jdk/src/java.logging/share/classes/java/util/logging/Level.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.logging/share/classes/java/util/logging/Level.java	Sat Jan 21 03:53:21 2017 +0000
@@ -692,11 +692,14 @@
                     Level levelObject = ref.get();
                     if (levelObject == null) continue;
                     Level other = ref.mirroredLevel;
+                    Class<? extends Level> type = levelObject.getClass();
                     if (l.value == other.value &&
                            (l.resourceBundleName == other.resourceBundleName ||
                                (l.resourceBundleName != null &&
                                 l.resourceBundleName.equals(other.resourceBundleName)))) {
-                        return Optional.of(levelObject);
+                        if (type == l.getClass()) {
+                            return Optional.of(levelObject);
+                        }
                     }
                 }
             }
--- a/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -619,13 +619,21 @@
             throw new IOException("LogRecord: bad version: " + major + "." + minor);
         }
         int len = in.readInt();
-        if (len == -1) {
+        if (len < -1) {
+            throw new NegativeArraySizeException();
+        } else if (len == -1) {
             parameters = null;
-        } else {
+        } else if (len < 255) {
             parameters = new Object[len];
             for (int i = 0; i < parameters.length; i++) {
                 parameters[i] = in.readObject();
             }
+        } else {
+            List<Object> params = new ArrayList<>(Math.min(len, 1024));
+            for (int i = 0; i < len; i++) {
+                params.add(in.readObject());
+            }
+            parameters = params.toArray(new Object[params.size()]);
         }
         // If necessary, try to regenerate the resource bundle.
         if (resourceBundleName != null) {
--- a/jdk/src/java.management/share/classes/com/sun/jmx/defaults/JmxProperties.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/defaults/JmxProperties.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 
 package com.sun.jmx.defaults;
 
-import java.util.logging.Logger;
+import java.lang.System.Logger;
 
 /**
  * This contains the property list defined for this
@@ -120,7 +120,7 @@
      * Logger for MBean Server information.
      */
     public static final Logger MBEANSERVER_LOGGER =
-            Logger.getLogger(MBEANSERVER_LOGGER_NAME);
+            System.getLogger(MBEANSERVER_LOGGER_NAME);
 
     /**
      * Logger name for MLet service information.
@@ -132,7 +132,7 @@
      * Logger for MLet service information.
      */
     public static final Logger MLET_LOGGER =
-            Logger.getLogger(MLET_LOGGER_NAME);
+            System.getLogger(MLET_LOGGER_NAME);
 
     /**
      * Logger name for Monitor information.
@@ -144,7 +144,7 @@
      * Logger for Monitor information.
      */
     public static final Logger MONITOR_LOGGER =
-            Logger.getLogger(MONITOR_LOGGER_NAME);
+            System.getLogger(MONITOR_LOGGER_NAME);
 
     /**
      * Logger name for Timer information.
@@ -156,7 +156,7 @@
      * Logger for Timer information.
      */
     public static final Logger TIMER_LOGGER =
-            Logger.getLogger(TIMER_LOGGER_NAME);
+            System.getLogger(TIMER_LOGGER_NAME);
 
     /**
      * Logger name for Event Management information.
@@ -168,7 +168,7 @@
      * Logger for Event Management information.
      */
     public static final Logger NOTIFICATION_LOGGER =
-            Logger.getLogger(NOTIFICATION_LOGGER_NAME);
+            System.getLogger(NOTIFICATION_LOGGER_NAME);
 
     /**
      * Logger name for Relation Service.
@@ -180,7 +180,7 @@
      * Logger for Relation Service.
      */
     public static final Logger RELATION_LOGGER =
-            Logger.getLogger(RELATION_LOGGER_NAME);
+            System.getLogger(RELATION_LOGGER_NAME);
 
     /**
      * Logger name for Model MBean.
@@ -192,7 +192,7 @@
      * Logger for Model MBean.
      */
     public static final Logger MODELMBEAN_LOGGER =
-            Logger.getLogger(MODELMBEAN_LOGGER_NAME);
+            System.getLogger(MODELMBEAN_LOGGER_NAME);
 
     /**
      * Logger name for all other JMX classes.
@@ -204,5 +204,5 @@
      * Logger for all other JMX classes.
      */
     public static final Logger MISC_LOGGER =
-            Logger.getLogger(MISC_LOGGER_NAME);
+            System.getLogger(MISC_LOGGER_NAME);
 }
--- a/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
 import java.util.List;
 import java.util.Set;
 import java.util.WeakHashMap;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 // JMX import
 import javax.management.Attribute;
@@ -258,19 +258,16 @@
 
         /* Load the appropriate class. */
         if (withDefaultLoaderRepository) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-                MBEANSERVER_LOGGER.logp(Level.FINER,
-                        DefaultMBeanServerInterceptor.class.getName(),
-                        "createMBean",
+            if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+                MBEANSERVER_LOGGER.log(Level.TRACE,
                         "ClassName = " + className + ", ObjectName = " + name);
             }
             theClass =
                 instantiator.findClassWithDefaultLoaderRepository(className);
         } else if (loaderName == null) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-                MBEANSERVER_LOGGER.logp(Level.FINER,
-                        DefaultMBeanServerInterceptor.class.getName(),
-                        "createMBean", "ClassName = " + className +
+            if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+                MBEANSERVER_LOGGER.log(Level.TRACE,
+                        "ClassName = " + className +
                         ", ObjectName = " + name + ", Loader name = null");
             }
 
@@ -279,10 +276,9 @@
         } else {
             loaderName = nonDefaultDomain(loaderName);
 
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-                MBEANSERVER_LOGGER.logp(Level.FINER,
-                        DefaultMBeanServerInterceptor.class.getName(),
-                        "createMBean", "ClassName = " + className +
+            if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+                MBEANSERVER_LOGGER.log(Level.TRACE,
+                        "ClassName = " + className +
                         ", ObjectName = " + name +
                         ", Loader name = " + loaderName);
             }
@@ -633,10 +629,8 @@
 
         name = nonDefaultDomain(name);
 
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "getAttribute",
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE,
                     "Attribute = " + attribute + ", ObjectName = " + name);
         }
 
@@ -670,10 +664,8 @@
 
         name = nonDefaultDomain(name);
 
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "getAttributes", "ObjectName = " + name);
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE, "ObjectName = " + name);
         }
 
         final DynamicMBean instance = getMBean(name);
@@ -732,10 +724,8 @@
 
         name = nonDefaultDomain(name);
 
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "setAttribute", "ObjectName = " + name +
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE, "ObjectName = " + name +
                     ", Attribute = " + attribute.getName());
         }
 
@@ -910,10 +900,9 @@
 
         name = nonDefaultDomain(name);
 
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "registerMBean", "ObjectName = " + name);
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE,
+                    "ObjectName = " + name);
         }
 
         ObjectName logicalName = preRegister(mbean, server, name);
@@ -1023,14 +1012,14 @@
             if (mbean instanceof MBeanRegistration)
                 ((MBeanRegistration) mbean).postRegister(registrationDone);
         } catch (RuntimeException e) {
-            MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
+            MBEANSERVER_LOGGER.log(Level.DEBUG, "While registering MBean ["+logicalName+
                     "]: " + "Exception thrown by postRegister: " +
                     "rethrowing <"+e+">, but keeping the MBean registered");
             throw new RuntimeMBeanException(e,
                       "RuntimeException thrown in postRegister method: "+
                       "rethrowing <"+e+">, but keeping the MBean registered");
         } catch (Error er) {
-            MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
+            MBEANSERVER_LOGGER.log(Level.DEBUG, "While registering MBean ["+logicalName+
                     "]: " + "Error thrown by postRegister: " +
                     "rethrowing <"+er+">, but keeping the MBean registered");
             throw new RuntimeErrorException(er,
@@ -1053,7 +1042,7 @@
         try {
             moi.postDeregister();
         } catch (RuntimeException e) {
-            MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
+            MBEANSERVER_LOGGER.log(Level.DEBUG, "While unregistering MBean ["+mbean+
                     "]: " + "Exception thrown by postDeregister: " +
                     "rethrowing <"+e+">, although the MBean is succesfully " +
                     "unregistered");
@@ -1062,7 +1051,7 @@
                       "rethrowing <"+e+
                       ">, although the MBean is sucessfully unregistered");
         } catch (Error er) {
-            MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
+            MBEANSERVER_LOGGER.log(Level.DEBUG, "While unregistering MBean ["+mbean+
                     "]: " + "Error thrown by postDeregister: " +
                     "rethrowing <"+er+">, although the MBean is succesfully " +
                     "unregistered");
@@ -1087,10 +1076,9 @@
         }
         DynamicMBean obj = repository.retrieve(name);
         if (obj == null) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-                MBEANSERVER_LOGGER.logp(Level.FINER,
-                        DefaultMBeanServerInterceptor.class.getName(),
-                        "getMBean", name + " : Found no object");
+            if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+                MBEANSERVER_LOGGER.log(Level.TRACE,
+                        name + " : Found no object");
             }
             throw new InstanceNotFoundException(name.toString());
         }
@@ -1176,10 +1164,8 @@
 
         // ------------------------------
         // ------------------------------
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "addNotificationListener", "ObjectName = " + name);
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE, "ObjectName = " + name);
         }
 
         DynamicMBean instance = getMBean(name);
@@ -1226,10 +1212,8 @@
         // ----------------
         // Add a listener on an MBean
         // ----------------
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "addNotificationListener",
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE,
                     "ObjectName = " + name + ", Listener = " + listener);
         }
         server.addNotificationListener(name,(NotificationListener) resource,
@@ -1255,10 +1239,8 @@
             throws InstanceNotFoundException, ListenerNotFoundException {
         NotificationListener instance = getListener(listener);
 
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "removeNotificationListener",
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE,
                     "ObjectName = " + name + ", Listener = " + listener);
         }
         server.removeNotificationListener(name, instance);
@@ -1272,10 +1254,8 @@
 
         NotificationListener instance = getListener(listener);
 
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "removeNotificationListener",
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE,
                     "ObjectName = " + name + ", Listener = " + listener);
         }
         server.removeNotificationListener(name, instance, filter, handback);
@@ -1313,10 +1293,8 @@
                                             boolean removeAll)
             throws InstanceNotFoundException, ListenerNotFoundException {
 
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "removeNotificationListener", "ObjectName = " + name);
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE, "ObjectName = " + name);
         }
 
         DynamicMBean instance = getMBean(name);
@@ -1421,10 +1399,9 @@
             return classNameClass.isAssignableFrom(resourceClass);
         } catch (Exception x) {
             /* Could be SecurityException or ClassNotFoundException */
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
-                MBEANSERVER_LOGGER.logp(Level.FINEST,
-                        DefaultMBeanServerInterceptor.class.getName(),
-                        "isInstanceOf", "Exception calling isInstanceOf", x);
+            if (MBEANSERVER_LOGGER.isLoggable(Level.DEBUG)) {
+                MBEANSERVER_LOGGER.log(Level.DEBUG,
+                        "Exception calling isInstanceOf", x);
             }
             return false;
         }
@@ -1489,10 +1466,8 @@
         MBeanServerNotification notif = new MBeanServerNotification(
             NotifType,MBeanServerDelegate.DELEGATE_NAME,0,name);
 
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "sendNotification", NotifType + " " + name);
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE, NotifType + " " + name);
         }
 
         delegate.sendNotification(notif);
@@ -1594,10 +1569,8 @@
         try {
             return getClassName(mbean);
         } catch (Exception e) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
-                MBEANSERVER_LOGGER.logp(Level.FINEST,
-                        DefaultMBeanServerInterceptor.class.getName(),
-                        "safeGetClassName",
+            if (MBEANSERVER_LOGGER.isLoggable(Level.DEBUG)) {
+                MBEANSERVER_LOGGER.log(Level.DEBUG,
                         "Exception getting MBean class name", e);
             }
             return null;
@@ -1885,10 +1858,9 @@
         // ---------------------
         // Send create event
         // ---------------------
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "addObject", "Send create notification of object " +
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE,
+                    "Send create notification of object " +
                     logicalName.getCanonicalName());
         }
 
@@ -1926,10 +1898,9 @@
         // ---------------------
         // Send deletion event
         // ---------------------
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    DefaultMBeanServerInterceptor.class.getName(),
-                    "unregisterMBean", "Send delete notification of object " +
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE,
+                    "Send delete notification of object " +
                     logicalName.getCanonicalName());
         }
 
--- a/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import javax.management.MBeanPermission;
 
 import javax.management.ObjectName;
@@ -148,10 +148,9 @@
     // from javax.management.loading.DefaultLoaderRepository
     public final Class<?> loadClassWithout(ClassLoader without, String className)
             throws ClassNotFoundException {
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    ClassLoaderRepositorySupport.class.getName(),
-                    "loadClassWithout", className + " without " + without);
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE,
+                    className + " without " + without);
         }
 
         // without is null => just behave as loadClass
@@ -172,10 +171,9 @@
 
     public final Class<?> loadClassBefore(ClassLoader stop, String className)
             throws ClassNotFoundException {
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    ClassLoaderRepositorySupport.class.getName(),
-                    "loadClassBefore", className + " before " + stop);
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE,
+                    className + " before " + stop);
         }
 
         if (stop == null)
@@ -206,10 +204,8 @@
                     continue;
                 if (cl == stop)
                     break;
-                if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-                    MBEANSERVER_LOGGER.logp(Level.FINER,
-                            ClassLoaderRepositorySupport.class.getName(),
-                            "loadClass", "Trying loader = " + cl);
+                if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+                    MBEANSERVER_LOGGER.log(Level.TRACE, "Trying loader = " + cl);
                 }
                 /* We used to have a special case for "instanceof
                    MLet" here, where we invoked the method
@@ -239,10 +235,9 @@
         //
         List<ClassLoader> excluded = search.get(className);
         if ((excluded!= null) && (excluded.contains(aloader))) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-                MBEANSERVER_LOGGER.logp(Level.FINER,
-                        ClassLoaderRepositorySupport.class.getName(),
-                        "startValidSearch", "Already requested loader = " +
+            if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+                MBEANSERVER_LOGGER.log(Level.TRACE,
+                        "Already requested loader = " +
                         aloader + " class = " + className);
             }
             throw new ClassNotFoundException(className);
@@ -255,10 +250,8 @@
             search.put(className, excluded);
         }
         excluded.add(aloader);
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    ClassLoaderRepositorySupport.class.getName(),
-                    "startValidSearch",
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE,
                     "loader = " + aloader + " class = " + className);
         }
     }
@@ -271,10 +264,8 @@
         List<ClassLoader> excluded = search.get(className);
         if (excluded != null) {
             excluded.remove(aloader);
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-                MBEANSERVER_LOGGER.logp(Level.FINER,
-                        ClassLoaderRepositorySupport.class.getName(),
-                        "stopValidSearch",
+            if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+                MBEANSERVER_LOGGER.log(Level.TRACE,
                         "loader = " + aloader + " class = " + className);
             }
         }
--- a/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/JmxMBeanServer.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/JmxMBeanServer.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
 import java.security.PrivilegedExceptionAction;
 import java.util.List;
 import java.util.Set;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 import javax.management.Attribute;
 import javax.management.AttributeList;
@@ -1229,16 +1229,14 @@
                 }
             });
         } catch (SecurityException e) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
-                MBEANSERVER_LOGGER.logp(Level.FINEST,
-                        JmxMBeanServer.class.getName(), "initialize",
+            if (MBEANSERVER_LOGGER.isLoggable(Level.DEBUG)) {
+                MBEANSERVER_LOGGER.log(Level.DEBUG,
                         "Unexpected security exception occurred", e);
             }
             throw e;
         } catch (Exception e) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
-                MBEANSERVER_LOGGER.logp(Level.FINEST,
-                        JmxMBeanServer.class.getName(), "initialize",
+            if (MBEANSERVER_LOGGER.isLoggable(Level.DEBUG)) {
+                MBEANSERVER_LOGGER.log(Level.DEBUG,
                         "Unexpected exception occurred", e);
             }
             throw new
--- a/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
 import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
 import java.util.Map;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 import javax.management.InstanceNotFoundException;
 import javax.management.MBeanException;
@@ -186,19 +186,15 @@
                 }
             }
         } catch (ClassNotFoundException e) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
-                MBEANSERVER_LOGGER.logp(Level.FINEST,
-                        MBeanInstantiator.class.getName(),
-                        "findSignatureClasses",
+            if (MBEANSERVER_LOGGER.isLoggable(Level.DEBUG)) {
+                MBEANSERVER_LOGGER.log(Level.DEBUG,
                         "The parameter class could not be found", e);
             }
             throw new ReflectionException(e,
                       "The parameter class could not be found");
         } catch (RuntimeException e) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
-                MBEANSERVER_LOGGER.logp(Level.FINEST,
-                        MBeanInstantiator.class.getName(),
-                        "findSignatureClasses",
+            if (MBEANSERVER_LOGGER.isLoggable(Level.DEBUG)) {
+                MBEANSERVER_LOGGER.log(Level.DEBUG,
                         "Unexpected exception", e);
             }
             throw e;
@@ -696,19 +692,15 @@
                 tab[i] = Class.forName(signature[i], false, aLoader);
             }
         } catch (ClassNotFoundException e) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
-                MBEANSERVER_LOGGER.logp(Level.FINEST,
-                        MBeanInstantiator.class.getName(),
-                        "findSignatureClasses",
+            if (MBEANSERVER_LOGGER.isLoggable(Level.DEBUG)) {
+                MBEANSERVER_LOGGER.log(Level.DEBUG,
                         "The parameter class could not be found", e);
             }
             throw new ReflectionException(e,
                       "The parameter class could not be found");
         } catch (RuntimeException e) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
-                MBEANSERVER_LOGGER.logp(Level.FINEST,
-                        MBeanInstantiator.class.getName(),
-                        "findSignatureClasses",
+            if (MBEANSERVER_LOGGER.isLoggable(Level.DEBUG)) {
+                MBEANSERVER_LOGGER.log(Level.DEBUG,
                         "Unexpected exception", e);
             }
             throw e;
--- a/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/MBeanServerDelegateImpl.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/MBeanServerDelegateImpl.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
  */
 package com.sun.jmx.mbeanserver;
 
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 import javax.management.Attribute;
 import javax.management.AttributeList;
@@ -244,10 +244,8 @@
             } catch (Exception x) {
                 // Skip the attribute that couldn't be obtained.
                 //
-                if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
-                    MBEANSERVER_LOGGER.logp(Level.FINEST,
-                            MBeanServerDelegateImpl.class.getName(),
-                            "getAttributes",
+                if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+                    MBEANSERVER_LOGGER.log(Level.TRACE,
                             "Attribute " + attn[i] + " not found");
                 }
             }
--- a/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/Repository.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/Repository.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import java.util.Map;
 import java.util.Set;
 import javax.management.DynamicMBean;
@@ -264,7 +264,7 @@
             context.unregistered();
         } catch (Exception x) {
             // shouldn't come here...
-            MBEANSERVER_LOGGER.log(Level.FINE,
+            MBEANSERVER_LOGGER.log(Level.DEBUG,
                     "Unexpected exception while unregistering "+name,
                     x);
         }
@@ -385,9 +385,8 @@
             final RegistrationContext context)
         throws InstanceAlreadyExistsException {
 
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER, Repository.class.getName(),
-                    "addMBean", "name = " + name);
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE, "name = " + name);
         }
 
         // Extract the domain name.
@@ -456,9 +455,8 @@
      *          false otherwise.
      */
     public boolean contains(ObjectName name) {
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER, Repository.class.getName(),
-                    "contains", " name = " + name);
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE, "name = " + name);
         }
         lock.readLock().lock();
         try {
@@ -478,9 +476,8 @@
      *          null otherwise.
      */
     public DynamicMBean retrieve(ObjectName name) {
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER, Repository.class.getName(),
-                    "retrieve", "name = " + name);
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE, "name = " + name);
         }
 
         // Calls internal retrieve method to get the named object
@@ -609,9 +606,8 @@
         throws InstanceNotFoundException {
 
         // Debugging stuff
-        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
-            MBEANSERVER_LOGGER.logp(Level.FINER, Repository.class.getName(),
-                    "remove", "name = " + name);
+        if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
+            MBEANSERVER_LOGGER.log(Level.TRACE, "name = " + name);
         }
 
         // Extract domain name.
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/util/ClassLogger.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/remote/util/ClassLogger.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,222 +25,188 @@
 
 package com.sun.jmx.remote.util;
 
-import java.util.logging.Logger;
+import java.lang.System.Logger;
+import java.lang.System.Logger.Level;
+import java.util.ResourceBundle;
 
-public class ClassLogger {
+public class ClassLogger implements System.Logger {
 
-    private static final boolean ok;
     private final String className;
     private final Logger logger;
 
-    static {
-        /* We attempt to work even if we are running in J2SE 1.3, where
-           there is no java.util.logging.  The technique we use here is
-           not strictly portable, but it does work with Sun's J2SE 1.3
-           at least.  This is just a best effort: the Right Thing is for
-           people to use at least J2SE 1.4.  */
-        boolean loaded = false;
-        try {
-            Class<?> c = java.util.logging.Logger.class;
-            loaded = true;
-        } catch (Error e) {
-            // OK.
-            // java.util.logger package is not available in this jvm.
-        }
-        ok = loaded;
-    }
-
     public ClassLogger(String subsystem, String className) {
-        if (ok)
-            logger = Logger.getLogger(subsystem);
-        else
-            logger = null;
+        logger = System.getLogger(subsystem);
         this.className = className;
     }
 
     public final boolean traceOn() {
-        return finerOn();
+        return logger.isLoggable(Level.TRACE);
     }
 
     public final boolean debugOn() {
-        return finestOn();
+        return logger.isLoggable(Level.DEBUG);
     }
 
     public final boolean warningOn() {
-        return ok && logger.isLoggable(java.util.logging.Level.WARNING);
+        return logger.isLoggable(Level.WARNING);
     }
 
     public final boolean infoOn() {
-        return ok && logger.isLoggable(java.util.logging.Level.INFO);
+        return logger.isLoggable(Level.INFO);
     }
 
     public final boolean configOn() {
-        return ok && logger.isLoggable(java.util.logging.Level.CONFIG);
+        return logger.isLoggable(Level.DEBUG);
     }
 
     public final boolean fineOn() {
-        return ok && logger.isLoggable(java.util.logging.Level.FINE);
+        return logger.isLoggable(Level.DEBUG);
     }
 
     public final boolean finerOn() {
-        return ok && logger.isLoggable(java.util.logging.Level.FINER);
+        return logger.isLoggable(Level.TRACE);
     }
 
     public final boolean finestOn() {
-        return ok && logger.isLoggable(java.util.logging.Level.FINEST);
+        return logger.isLoggable(Level.TRACE);
     }
 
     public final void debug(String func, String msg) {
-        finest(func,msg);
+        logger.log(Level.DEBUG, msg);
     }
 
     public final void debug(String func, Throwable t) {
-        finest(func,t);
+        logger.log(Level.DEBUG, className + "::" + func, t);
     }
 
     public final void debug(String func, String msg, Throwable t) {
-        finest(func,msg,t);
+        logger.log(Level.DEBUG, msg, t);
     }
 
     public final void trace(String func, String msg) {
-        finer(func,msg);
+        logger.log(Level.TRACE, msg);
     }
 
     public final void trace(String func, Throwable t) {
-        finer(func,t);
+        logger.log(Level.TRACE, className + "::" + func, t);
     }
 
     public final void trace(String func, String msg, Throwable t) {
-        finer(func,msg,t);
+        logger.log(Level.TRACE, msg, t);
     }
 
     public final void error(String func, String msg) {
-        severe(func,msg);
+        logger.log(Level.ERROR, msg);
     }
 
     public final void error(String func, Throwable t) {
-        severe(func,t);
+        logger.log(Level.ERROR, className + "::" + func, t);
     }
 
     public final void error(String func, String msg, Throwable t) {
-        severe(func,msg,t);
+        logger.log(Level.ERROR, msg, t);
     }
 
     public final void finest(String func, String msg) {
-        if (ok)
-            logger.logp(java.util.logging.Level.FINEST, className, func, msg);
+        logger.log(Level.TRACE, msg);
     }
 
     public final void finest(String func, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.FINEST, className, func,
-                        t.toString(), t);
+        logger.log(Level.TRACE, className + "::" + func, t);
     }
 
     public final void finest(String func, String msg, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.FINEST, className, func, msg,
-                        t);
+        logger.log(Level.TRACE, msg, t);
     }
 
     public final void finer(String func, String msg) {
-        if (ok)
-            logger.logp(java.util.logging.Level.FINER, className, func, msg);
+        logger.log(Level.TRACE, msg);
     }
 
     public final void finer(String func, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.FINER, className, func,
-                        t.toString(), t);
+        logger.log(Level.TRACE, className + "::" + func, t);
     }
 
     public final void finer(String func, String msg, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.FINER, className, func, msg,t);
+        logger.log(Level.DEBUG, msg, t);
     }
 
     public final void fine(String func, String msg) {
-        if (ok)
-            logger.logp(java.util.logging.Level.FINE, className, func, msg);
+        logger.log(Level.DEBUG, msg);
     }
 
     public final void fine(String func, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.FINE, className, func,
-                        t.toString(), t);
+        logger.log(Level.DEBUG, className + "::" + func, t);
     }
 
     public final void fine(String func, String msg, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.FINE, className, func, msg,
-                        t);
+        logger.log(Level.DEBUG, msg, t);
     }
 
     public final void config(String func, String msg) {
-        if (ok)
-            logger.logp(java.util.logging.Level.CONFIG, className, func, msg);
+        logger.log(Level.DEBUG, msg);
     }
 
     public final void config(String func, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.CONFIG, className, func,
-                        t.toString(), t);
+        logger.log(Level.DEBUG, className + "::" + func, t);
     }
 
     public final void config(String func, String msg, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.CONFIG, className, func, msg,
-                        t);
+        logger.log(Level.DEBUG, msg, t);
     }
 
     public final void info(String func, String msg) {
-        if (ok)
-            logger.logp(java.util.logging.Level.INFO, className, func, msg);
+        logger.log(Level.INFO, msg);
     }
 
     public final void info(String func, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.INFO, className, func,
-                        t.toString(), t);
+        logger.log(Level.INFO, className + "::" + func, t);
     }
 
     public final void info(String func, String msg, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.INFO, className, func, msg,
-                        t);
+        logger.log(Level.INFO, msg, t);
     }
 
     public final void warning(String func, String msg) {
-        if (ok)
-            logger.logp(java.util.logging.Level.WARNING, className, func, msg);
+        logger.log(Level.WARNING, msg);
     }
 
     public final void warning(String func, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.WARNING, className, func,
-                        t.toString(), t);
+        logger.log(Level.WARNING, className + "::" + func, t);
     }
 
     public final void warning(String func, String msg, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.WARNING, className, func, msg,
-                        t);
+        logger.log(Level.WARNING, msg, t);
     }
 
     public final void severe(String func, String msg) {
-        if (ok)
-            logger.logp(java.util.logging.Level.SEVERE, className, func, msg);
+        logger.log(Level.ERROR, msg);
     }
 
     public final void severe(String func, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.SEVERE, className, func,
-                        t.toString(), t);
+        logger.log(Level.ERROR, className + "::" + func, t);
     }
 
     public final void severe(String func, String msg, Throwable t) {
-        if (ok)
-            logger.logp(java.util.logging.Level.SEVERE, className, func, msg,
-                        t);
+        logger.log(Level.ERROR, msg, t);
+    }
+
+    public final String getName() {
+        return logger.getName();
+    }
+
+    public final boolean isLoggable(Level level) {
+        return logger.isLoggable(level);
     }
+
+    public final void log(Level level, ResourceBundle bundle, String msg,
+            Throwable thrown) {
+        logger.log(level, bundle, msg, thrown);
+    }
+
+    public final void log(Level level, ResourceBundle bundle, String format,
+                    Object... params) {
+        logger.log(level, bundle, format, params);
+    }
+
 }
--- a/jdk/src/java.management/share/classes/javax/management/MBeanServerDelegate.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/MBeanServerDelegate.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 
 package javax.management;
 
+import java.lang.System.Logger.Level;
 import com.sun.jmx.defaults.JmxProperties;
 import com.sun.jmx.defaults.ServiceName;
 import com.sun.jmx.mbeanserver.Util;
@@ -84,7 +85,8 @@
             try {
                 localHost = java.net.InetAddress.getLocalHost().getHostName();
             } catch (java.net.UnknownHostException e) {
-                JmxProperties.MISC_LOGGER.finest("Can't get local host name, " +
+                JmxProperties.MISC_LOGGER.log(Level.TRACE,
+                        "Can't get local host name, " +
                         "using \"localhost\" instead. Cause is: "+e);
                 localHost = "localhost";
             }
--- a/jdk/src/java.management/share/classes/javax/management/MBeanServerFactory.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/MBeanServerFactory.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
 import java.security.AccessController;
 import java.security.Permission;
 import java.util.ArrayList;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import javax.management.loading.ClassLoaderRepository;
 import sun.reflect.misc.ReflectUtil;
 
@@ -399,7 +399,7 @@
             return (String) mbs.getAttribute(MBeanServerDelegate.DELEGATE_NAME,
                     "MBeanServerId");
         } catch (JMException e) {
-            JmxProperties.MISC_LOGGER.finest(
+            JmxProperties.MISC_LOGGER.log(Level.TRACE,
                     "Ignoring exception while getting MBeanServerId: "+e);
             return null;
         }
@@ -421,9 +421,7 @@
     private static synchronized void removeMBeanServer(MBeanServer mbs) {
         boolean removed = mBeanServerList.remove(mbs);
         if (!removed) {
-            MBEANSERVER_LOGGER.logp(Level.FINER,
-                    MBeanServerFactory.class.getName(),
-                    "removeMBeanServer(MBeanServer)",
+            MBEANSERVER_LOGGER.log(Level.TRACE,
                     "MBeanServer was not in list!");
             throw new IllegalArgumentException("MBeanServer was not in list!");
         }
@@ -504,15 +502,12 @@
                 throw new JMRuntimeException(msg, x);
             }
         } catch (RuntimeException x) {
-            if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
+            if (MBEANSERVER_LOGGER.isLoggable(Level.DEBUG)) {
                 StringBuilder strb = new StringBuilder()
                 .append("Failed to instantiate MBeanServerBuilder: ").append(x)
                 .append("\n\t\tCheck the value of the ")
                 .append(JMX_INITIAL_BUILDER).append(" property.");
-                MBEANSERVER_LOGGER.logp(Level.FINEST,
-                        MBeanServerFactory.class.getName(),
-                        "checkMBeanServerBuilder",
-                        strb.toString());
+                MBEANSERVER_LOGGER.log(Level.DEBUG, strb::toString);
             }
             throw x;
         }
--- a/jdk/src/java.management/share/classes/javax/management/StandardMBean.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/StandardMBean.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.WeakHashMap;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import javax.management.openmbean.OpenMBeanAttributeInfo;
 import javax.management.openmbean.OpenMBeanAttributeInfoSupport;
 import javax.management.openmbean.OpenMBeanConstructorInfo;
@@ -432,16 +432,14 @@
             final MBeanInfo cached = getCachedMBeanInfo();
             if (cached != null) return cached;
         } catch (RuntimeException x) {
-            if (MISC_LOGGER.isLoggable(Level.FINEST)) {
-                MISC_LOGGER.logp(Level.FINEST,
-                        MBeanServerFactory.class.getName(), "getMBeanInfo",
+            if (MISC_LOGGER.isLoggable(Level.DEBUG)) {
+                MISC_LOGGER.log(Level.DEBUG,
                         "Failed to get cached MBeanInfo", x);
             }
         }
 
-        if (MISC_LOGGER.isLoggable(Level.FINER)) {
-            MISC_LOGGER.logp(Level.FINER,
-                    MBeanServerFactory.class.getName(), "getMBeanInfo",
+        if (MISC_LOGGER.isLoggable(Level.TRACE)) {
+            MISC_LOGGER.log(Level.TRACE,
                     "Building MBeanInfo for " +
                     getImplementationClass().getName());
         }
@@ -465,9 +463,8 @@
         try {
             cacheMBeanInfo(nmbi);
         } catch (RuntimeException x) {
-            if (MISC_LOGGER.isLoggable(Level.FINEST)) {
-                MISC_LOGGER.logp(Level.FINEST,
-                        MBeanServerFactory.class.getName(), "getMBeanInfo",
+            if (MISC_LOGGER.isLoggable(Level.DEBUG)) {
+                MISC_LOGGER.log(Level.DEBUG,
                         "Failed to cache MBeanInfo", x);
             }
         }
--- a/jdk/src/java.management/share/classes/javax/management/loading/DefaultLoaderRepository.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/loading/DefaultLoaderRepository.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER;
 import java.util.Iterator;
 import java.util.List;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
 
@@ -71,9 +71,7 @@
      */
     public static Class<?> loadClass(String className)
         throws ClassNotFoundException {
-        MBEANSERVER_LOGGER.logp(Level.FINEST,
-                DefaultLoaderRepository.class.getName(),
-                "loadClass", className);
+        MBEANSERVER_LOGGER.log(Level.TRACE, className);
         return load(null, className);
     }
 
@@ -96,9 +94,7 @@
     public static Class<?> loadClassWithout(ClassLoader loader,
                                          String className)
         throws ClassNotFoundException {
-        MBEANSERVER_LOGGER.logp(Level.FINEST,
-                DefaultLoaderRepository.class.getName(),
-                "loadClassWithout", className);
+        MBEANSERVER_LOGGER.log(Level.TRACE, className);
         return load(loader, className);
     }
 
--- a/jdk/src/java.management/share/classes/javax/management/loading/MLet.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/loading/MLet.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import java.util.Map;
 import java.util.Set;
 import java.util.StringTokenizer;
@@ -412,9 +412,8 @@
              if (!Arrays.asList(getURLs()).contains(ur))
                  super.addURL(ur);
          } catch (MalformedURLException e) {
-             if (MLET_LOGGER.isLoggable(Level.FINEST)) {
-                 MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                         "addUrl", "Malformed URL: " + url, e);
+             if (MLET_LOGGER.isLoggable(Level.DEBUG)) {
+                 MLET_LOGGER.log(Level.DEBUG, "Malformed URL: " + url, e);
              }
              throw new
                  ServiceNotFoundException("The specified URL is malformed");
@@ -481,23 +480,19 @@
      public Set<Object> getMBeansFromURL(String url)
              throws ServiceNotFoundException  {
 
-         String mth = "getMBeansFromURL";
-
          if (server == null) {
              throw new IllegalStateException("This MLet MBean is not " +
                                              "registered with an MBeanServer.");
          }
          // Parse arguments
          if (url == null) {
-             MLET_LOGGER.logp(Level.FINER, MLet.class.getName(),
-                     mth, "URL is null");
+             MLET_LOGGER.log(Level.TRACE, "URL is null");
              throw new ServiceNotFoundException("The specified URL is null");
          } else {
              url = url.replace(File.separatorChar,'/');
          }
-         if (MLET_LOGGER.isLoggable(Level.FINER)) {
-             MLET_LOGGER.logp(Level.FINER, MLet.class.getName(),
-                     mth, "<URL = " + url + ">");
+         if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+             MLET_LOGGER.log(Level.TRACE, "<URL = " + url + ">");
          }
 
          // Parse URL
@@ -508,7 +503,7 @@
              final String msg =
                  "Problems while parsing URL [" + url +
                  "], got exception [" + e.toString() + "]";
-             MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth, msg);
+             MLET_LOGGER.log(Level.TRACE, msg);
              throw EnvHelp.initCause(new ServiceNotFoundException(msg), e);
          }
 
@@ -516,7 +511,7 @@
          if (mletList.size() == 0) {
              final String msg =
                  "File " + url + " not found or MLET tag not defined in file";
-             MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth, msg);
+             MLET_LOGGER.log(Level.TRACE, msg);
              throw new ServiceNotFoundException(msg);
          }
 
@@ -538,7 +533,7 @@
              URL documentBase = elmt.getDocumentBase();
 
              // Display debug information
-             if (MLET_LOGGER.isLoggable(Level.FINER)) {
+             if (MLET_LOGGER.isLoggable(Level.TRACE)) {
                  final StringBuilder strb = new StringBuilder()
                  .append("\n\tMLET TAG     = ").append(elmt.getAttributes())
                  .append("\n\tCODEBASE     = ").append(codebase)
@@ -548,16 +543,15 @@
                  .append("\n\tNAME         = ").append(name)
                  .append("\n\tVERSION      = ").append(version)
                  .append("\n\tDOCUMENT URL = ").append(documentBase);
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(),
-                         mth, strb.toString());
+                 MLET_LOGGER.log(Level.TRACE, strb::toString);
              }
 
              // Load classes from JAR files
              StringTokenizer st = new StringTokenizer(jarFiles, ",", false);
              while (st.hasMoreTokens()) {
                  String tok = st.nextToken().trim();
-                 if (MLET_LOGGER.isLoggable(Level.FINER)) {
-                     MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
+                 if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+                     MLET_LOGGER.log(Level.TRACE,
                              "Load archive for codebase <" + codebase +
                              ">, file <" + tok + ">");
                  }
@@ -570,8 +564,8 @@
                  try {
                      codebase = check(version, codebase, tok, elmt);
                  } catch (Exception ex) {
-                     MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                             mth, "Got unexpected exception", ex);
+                     MLET_LOGGER.log(Level.DEBUG,
+                             "Got unexpected exception", ex);
                      mbeans.add(ex);
                      continue;
                  }
@@ -599,7 +593,7 @@
                  final String msg =
                      "CODE and OBJECT parameters cannot be specified at the " +
                      "same time in tag MLET";
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth, msg);
+                 MLET_LOGGER.log(Level.TRACE, msg);
                  mbeans.add(new Error(msg));
                  continue;
              }
@@ -607,7 +601,7 @@
                  final String msg =
                      "Either CODE or OBJECT parameter must be specified in " +
                      "tag MLET";
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth, msg);
+                 MLET_LOGGER.log(Level.TRACE, msg);
                  mbeans.add(new Error(msg));
                  continue;
              }
@@ -635,7 +629,7 @@
                          Object[] parms = objectPars.toArray();
                          String[] signature = new String[signat.size()];
                          signat.toArray(signature);
-                         if (MLET_LOGGER.isLoggable(Level.FINEST)) {
+                         if (MLET_LOGGER.isLoggable(Level.TRACE)) {
                              final StringBuilder strb = new StringBuilder();
                              for (int i = 0; i < signature.length; i++) {
                                  strb.append("\n\tSignature     = ")
@@ -643,9 +637,7 @@
                                  .append("\t\nParams        = ")
                                  .append(parms[i]);
                              }
-                             MLET_LOGGER.logp(Level.FINEST,
-                                     MLet.class.getName(),
-                                     mth, strb.toString());
+                             MLET_LOGGER.log(Level.TRACE, strb::toString);
                          }
                          if (name == null) {
                              objInst =
@@ -668,53 +660,46 @@
                      objInst = new ObjectInstance(name, o.getClass().getName());
                  }
              } catch (ReflectionException  ex) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
-                         "ReflectionException", ex);
+                 MLET_LOGGER.log(Level.TRACE, "ReflectionException", ex);
                  mbeans.add(ex);
                  continue;
              } catch (InstanceAlreadyExistsException  ex) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
+                 MLET_LOGGER.log(Level.TRACE,
                          "InstanceAlreadyExistsException", ex);
                  mbeans.add(ex);
                  continue;
              } catch (MBeanRegistrationException ex) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
-                         "MBeanRegistrationException", ex);
+                 MLET_LOGGER.log(Level.TRACE, "MBeanRegistrationException", ex);
                  mbeans.add(ex);
                  continue;
              } catch (MBeanException  ex) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
-                         "MBeanException", ex);
+                 MLET_LOGGER.log(Level.TRACE, "MBeanException", ex);
                  mbeans.add(ex);
                  continue;
              } catch (NotCompliantMBeanException  ex) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
+                 MLET_LOGGER.log(Level.TRACE,
                          "NotCompliantMBeanException", ex);
                  mbeans.add(ex);
                  continue;
              } catch (InstanceNotFoundException   ex) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
+                 MLET_LOGGER.log(Level.TRACE,
                          "InstanceNotFoundException", ex);
                  mbeans.add(ex);
                  continue;
              } catch (IOException ex) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
-                         "IOException", ex);
+                 MLET_LOGGER.log(Level.TRACE, "IOException", ex);
                  mbeans.add(ex);
                  continue;
              } catch (SecurityException ex) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
-                         "SecurityException", ex);
+                 MLET_LOGGER.log(Level.TRACE, "SecurityException", ex);
                  mbeans.add(ex);
                  continue;
              } catch (Exception ex) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
-                         "Exception", ex);
+                 MLET_LOGGER.log(Level.TRACE, "Exception", ex);
                  mbeans.add(ex);
                  continue;
              } catch (Error ex) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
-                         "Error", ex);
+                 MLET_LOGGER.log(Level.TRACE, "Error", ex);
                  mbeans.add(ex);
                  continue;
              }
@@ -937,20 +922,18 @@
      Class<?> findClass(String name, ClassLoaderRepository clr)
          throws ClassNotFoundException {
          Class<?> c = null;
-         MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), "findClass", name);
+         MLET_LOGGER.log(Level.TRACE, name);
          // Try looking in the JAR:
          try {
              c = super.findClass(name);
-             if (MLET_LOGGER.isLoggable(Level.FINER)) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(),
-                         "findClass",
+             if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+                 MLET_LOGGER.log(Level.TRACE,
                          "Class " + name + " loaded through MLet classloader");
              }
          } catch (ClassNotFoundException e) {
              // Drop through
-             if (MLET_LOGGER.isLoggable(Level.FINEST)) {
-                 MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                         "findClass",
+             if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+                 MLET_LOGGER.log(Level.TRACE,
                          "Class " + name + " not found locally");
              }
          }
@@ -959,32 +942,28 @@
              // Try the classloader repository:
              //
              try {
-                 if (MLET_LOGGER.isLoggable(Level.FINEST)) {
-                     MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                             "findClass",
+                 if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+                     MLET_LOGGER.log(Level.TRACE,
                              "Class " + name + " : looking in CLR");
                  }
                  c = clr.loadClassBefore(this, name);
                  // The loadClassBefore method never returns null.
                  // If the class is not found we get an exception.
-                 if (MLET_LOGGER.isLoggable(Level.FINER)) {
-                     MLET_LOGGER.logp(Level.FINER, MLet.class.getName(),
-                             "findClass",
+                 if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+                     MLET_LOGGER.log(Level.TRACE,
                              "Class " + name + " loaded through " +
                              "the default classloader repository");
                  }
              } catch (ClassNotFoundException e) {
                  // Drop through
-                 if (MLET_LOGGER.isLoggable(Level.FINEST)) {
-                     MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                             "findClass",
+                 if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+                     MLET_LOGGER.log(Level.TRACE,
                              "Class " + name + " not found in CLR");
                  }
              }
          }
          if (c == null) {
-             MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                     "findClass", "Failed to load class " + name);
+             MLET_LOGGER.log(Level.TRACE, "Failed to load class " + name);
              throw new ClassNotFoundException(name);
          }
          return c;
@@ -1041,8 +1020,8 @@
          //
          // See if the native library is accessible as a resource through the JAR file.
          //
-         if (MLET_LOGGER.isLoggable(Level.FINER)) {
-             MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
+         if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+             MLET_LOGGER.log(Level.TRACE,
                      "Search " + libname + " in all JAR files");
          }
 
@@ -1051,14 +1030,14 @@
          // for "foo" on Solaris SPARC 5.7 we try to load "libfoo.so"
          // from the JAR file.
          //
-         if (MLET_LOGGER.isLoggable(Level.FINER)) {
-             MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
+         if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+             MLET_LOGGER.log(Level.TRACE,
                      "loadLibraryAsResource(" + nativelibname + ")");
          }
          abs_path = loadLibraryAsResource(nativelibname);
          if (abs_path != null) {
-             if (MLET_LOGGER.isLoggable(Level.FINER)) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
+             if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+                 MLET_LOGGER.log(Level.TRACE,
                          nativelibname + " loaded, absolute path = " + abs_path);
              }
              return abs_path;
@@ -1073,15 +1052,15 @@
              removeSpace(System.getProperty("os.arch")) + File.separator +
              removeSpace(System.getProperty("os.version")) + File.separator +
              "lib" + File.separator + nativelibname;
-         if (MLET_LOGGER.isLoggable(Level.FINER)) {
-             MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
+         if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+             MLET_LOGGER.log(Level.TRACE,
                      "loadLibraryAsResource(" + nativelibname + ")");
          }
 
          abs_path = loadLibraryAsResource(nativelibname);
          if (abs_path != null) {
-             if (MLET_LOGGER.isLoggable(Level.FINER)) {
-                 MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
+             if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+                 MLET_LOGGER.log(Level.TRACE,
                          nativelibname + " loaded, absolute path = " + abs_path);
              }
              return abs_path;
@@ -1091,10 +1070,10 @@
          // All paths exhausted, library not found in JAR file.
          //
 
-         if (MLET_LOGGER.isLoggable(Level.FINER)) {
-             MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
+         if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+             MLET_LOGGER.log(Level.TRACE,
                      libname + " not found in any JAR file");
-             MLET_LOGGER.logp(Level.FINER, MLet.class.getName(), mth,
+             MLET_LOGGER.log(Level.TRACE,
                      "Search " + libname + " along the path " +
                      "specified as the java.library.path property");
          }
@@ -1127,8 +1106,8 @@
              if (tmpDirFile == null) return null;
              return tmpDirFile.getAbsolutePath();
          } catch (Exception x) {
-             MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                     "getTmpDir", "Failed to determine system temporary dir");
+             MLET_LOGGER.log(Level.DEBUG,
+                     "Failed to determine system temporary dir");
              return null;
          } finally {
              // Cleanup ...
@@ -1136,12 +1115,12 @@
                  try {
                      boolean deleted = tmpFile.delete();
                      if (!deleted) {
-                         MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                                 "getTmpDir", "Failed to delete temp file");
+                         MLET_LOGGER.log(Level.DEBUG,
+                                 "Failed to delete temp file");
                      }
                  } catch (Exception x) {
-                     MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                             "getTmpDir", "Failed to delete temporary file", x);
+                     MLET_LOGGER.log(Level.DEBUG,
+                             "Failed to delete temporary file", x);
                  }
              }
         }
@@ -1183,8 +1162,7 @@
                  }
              }
          } catch (Exception e) {
-             MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                     "loadLibraryAsResource",
+             MLET_LOGGER.log(Level.DEBUG,
                      "Failed to load library : " + libname, e);
              return null;
          }
@@ -1248,9 +1226,8 @@
         if (filename != null) {
             filename = filename.replace(File.separatorChar,'/');
         }
-        if (MLET_LOGGER.isLoggable(Level.FINER)) {
-            MLET_LOGGER.logp(Level.FINER, MLet.class.getName(),
-                    "loadSerializedObject", codebase.toString() + filename);
+        if (MLET_LOGGER.isLoggable(Level.TRACE)) {
+            MLET_LOGGER.log(Level.TRACE, codebase.toString() + filename);
         }
         InputStream is = getResourceAsStream(filename);
         if (is != null) {
@@ -1260,24 +1237,21 @@
                 ois.close();
                 return serObject;
             } catch (IOException e) {
-                if (MLET_LOGGER.isLoggable(Level.FINEST)) {
-                    MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                            "loadSerializedObject",
+                if (MLET_LOGGER.isLoggable(Level.DEBUG)) {
+                    MLET_LOGGER.log(Level.DEBUG,
                             "Exception while deserializing " + filename, e);
                 }
                 throw e;
             } catch (ClassNotFoundException e) {
-                if (MLET_LOGGER.isLoggable(Level.FINEST)) {
-                    MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                            "loadSerializedObject",
+                if (MLET_LOGGER.isLoggable(Level.DEBUG)) {
+                    MLET_LOGGER.log(Level.DEBUG,
                             "Exception while deserializing " + filename, e);
                 }
                 throw e;
             }
         } else {
-            if (MLET_LOGGER.isLoggable(Level.FINEST)) {
-                MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                        "loadSerializedObject", "Error: File " + filename +
+            if (MLET_LOGGER.isLoggable(Level.DEBUG)) {
+                MLET_LOGGER.log(Level.DEBUG, "Error: File " + filename +
                         " containing serialized object not found");
             }
             throw new Error("File " + filename + " containing serialized object not found");
@@ -1300,8 +1274,7 @@
                 return(cons.newInstance(oo));
 
             } catch (Exception  e) {
-                MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                        "constructParameter", "Got unexpected exception", e);
+                MLET_LOGGER.log(Level.DEBUG, "Got unexpected exception", e);
             }
         }
         if (type.compareTo("java.lang.Boolean") == 0)
--- a/jdk/src/java.management/share/classes/javax/management/loading/MLetParser.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/loading/MLetParser.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 /**
  * This class is used for parsing URLs.
@@ -153,7 +153,6 @@
      * Scan an html file for {@literal <mlet>} tags.
      */
     public List<MLetContent> parse(URL url) throws IOException {
-        String mth = "parse";
         // Warning Messages
         String requiresTypeWarning = "<arg type=... value=...> tag requires type parameter.";
         String requiresValueWarning = "<arg type=... value=...> tag requires value parameter.";
@@ -204,33 +203,25 @@
                         Map<String,String> t = scanTag(in);
                         String att = t.get("type");
                         if (att == null) {
-                            MLET_LOGGER.logp(Level.FINER,
-                                    MLetParser.class.getName(),
-                                    mth, requiresTypeWarning);
+                            MLET_LOGGER.log(Level.TRACE, requiresTypeWarning);
                             throw new IOException(requiresTypeWarning);
                         } else {
                             if (atts != null) {
                                 types.add(att);
                             } else {
-                                MLET_LOGGER.logp(Level.FINER,
-                                        MLetParser.class.getName(),
-                                        mth, paramOutsideWarning);
+                                MLET_LOGGER.log(Level.TRACE, paramOutsideWarning);
                                 throw new IOException(paramOutsideWarning);
                             }
                         }
                         String val = t.get("value");
                         if (val == null) {
-                            MLET_LOGGER.logp(Level.FINER,
-                                    MLetParser.class.getName(),
-                                    mth, requiresValueWarning);
+                            MLET_LOGGER.log(Level.TRACE, requiresValueWarning);
                             throw new IOException(requiresValueWarning);
                         } else {
                             if (atts != null) {
                                 values.add(val);
                             } else {
-                                MLET_LOGGER.logp(Level.FINER,
-                                        MLetParser.class.getName(),
-                                        mth, paramOutsideWarning);
+                                MLET_LOGGER.log(Level.TRACE, paramOutsideWarning);
                                 throw new IOException(paramOutsideWarning);
                             }
                         }
@@ -238,15 +229,11 @@
                         if (nm.equalsIgnoreCase(tag)) {
                             atts = scanTag(in);
                             if (atts.get("code") == null && atts.get("object") == null) {
-                                MLET_LOGGER.logp(Level.FINER,
-                                        MLetParser.class.getName(),
-                                        mth, requiresCodeWarning);
+                                MLET_LOGGER.log(Level.TRACE, requiresCodeWarning);
                                 throw new IOException(requiresCodeWarning);
                             }
                             if (atts.get("archive") == null) {
-                                MLET_LOGGER.logp(Level.FINER,
-                                        MLetParser.class.getName(),
-                                        mth, requiresJarsWarning);
+                                MLET_LOGGER.log(Level.TRACE, requiresJarsWarning);
                                 throw new IOException(requiresJarsWarning);
                             }
                         }
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
 import java.util.SortedMap;
 import java.util.StringTokenizer;
 import java.util.TreeMap;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 import javax.management.Descriptor;
 import javax.management.ImmutableDescriptor;
@@ -164,10 +164,8 @@
      * (the method {@link #isValid isValid} returns <CODE>false</CODE>)
      */
     public DescriptorSupport() {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "DescriptorSupport()" , "Constructor");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Constructor");
         }
         init(null);
     }
@@ -188,17 +186,14 @@
      */
     public DescriptorSupport(int initNumFields)
             throws MBeanException, RuntimeOperationsException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "Descriptor(initNumFields = " + initNumFields + ")",
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Descriptor(initNumFields = " + initNumFields + ") " +
                     "Constructor");
         }
         if (initNumFields <= 0) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                MODELMBEAN_LOGGER.logp(Level.FINEST,
-                        DescriptorSupport.class.getName(),
-                        "Descriptor(initNumFields)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                         "Illegal arguments: initNumFields <= 0");
             }
             final String msg =
@@ -219,10 +214,9 @@
      * fields, an empty Descriptor will be created.
      */
     public DescriptorSupport(DescriptorSupport inDescr) {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "Descriptor(Descriptor)", "Constructor");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Descriptor(Descriptor) Constructor");
         }
         if (inDescr == null)
             init(null);
@@ -268,16 +262,14 @@
                    XMLParseException {
         /* parse an XML-formatted string and populate internal
          * structure with it */
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "Descriptor(String = '" + inStr + "')", "Constructor");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Descriptor(String = '" + inStr + "') Constructor");
         }
         if (inStr == null) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                MODELMBEAN_LOGGER.logp(Level.FINEST,
-                        DescriptorSupport.class.getName(),
-                        "Descriptor(String = null)", "Illegal arguments");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "Descriptor(String = null) Illegal arguments");
             }
             final String msg = "String in parameter is null";
             final RuntimeException iae = new IllegalArgumentException(msg);
@@ -350,10 +342,9 @@
                 }
             }
         }  // while tokens
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "Descriptor(XMLString)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Descriptor(XMLString) Exit");
         }
     }
 
@@ -380,19 +371,17 @@
      */
     public DescriptorSupport(String[] fieldNames, Object[] fieldValues)
             throws RuntimeOperationsException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "Descriptor(fieldNames,fieldObjects)", "Constructor");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Descriptor(fieldNames,fieldObjects) Constructor");
         }
 
         if ((fieldNames == null) || (fieldValues == null) ||
             (fieldNames.length != fieldValues.length)) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                MODELMBEAN_LOGGER.logp(Level.FINEST,
-                        DescriptorSupport.class.getName(),
-                        "Descriptor(fieldNames,fieldObjects)",
-                        "Illegal arguments");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "Descriptor(fieldNames,fieldObjects)" +
+                        " Illegal arguments");
             }
 
             final String msg =
@@ -408,10 +397,9 @@
             // the fieldName and fieldValue will be validated in setField.
             setField(fieldNames[i], fieldValues[i]);
         }
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "Descriptor(fieldNames,fieldObjects)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Descriptor(fieldNames,fieldObjects) Exit");
         }
     }
 
@@ -444,10 +432,9 @@
      */
     public DescriptorSupport(String... fields)
     {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "Descriptor(String... fields)", "Constructor");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Descriptor(String... fields) Constructor");
         }
         init(null);
         if (( fields == null ) || ( fields.length == 0))
@@ -462,10 +449,9 @@
             int eq_separator = fields[i].indexOf('=');
             if (eq_separator < 0) {
                 // illegal if no = or is first character
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINEST,
-                            DescriptorSupport.class.getName(),
-                            "Descriptor(String... fields)",
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                            "Descriptor(String... fields) " +
                             "Illegal arguments: field does not have " +
                             "'=' as a name and value separator");
                 }
@@ -482,10 +468,9 @@
             }
 
             if (fieldName.equals("")) {
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINEST,
-                            DescriptorSupport.class.getName(),
-                            "Descriptor(String... fields)",
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                            "Descriptor(String... fields) " +
                             "Illegal arguments: fieldName is empty");
                 }
 
@@ -496,10 +481,9 @@
 
             setField(fieldName,fieldValue);
         }
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "Descriptor(String... fields)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Descriptor(String... fields) Exit");
         }
     }
 
@@ -517,10 +501,8 @@
             throws RuntimeOperationsException {
 
         if ((fieldName == null) || (fieldName.equals(""))) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                MODELMBEAN_LOGGER.logp(Level.FINEST,
-                        DescriptorSupport.class.getName(),
-                        "getFieldValue(String fieldName)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                         "Illegal arguments: null field name");
             }
             final String msg = "Fieldname requested is null";
@@ -528,10 +510,9 @@
             throw new RuntimeOperationsException(iae, msg);
         }
         Object retValue = descriptorMap.get(fieldName);
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "getFieldValue(String fieldName = " + fieldName + ")",
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "getFieldValue(String fieldName = " + fieldName + ") " +
                     "Returns '" + retValue + "'");
         }
         return(retValue);
@@ -542,10 +523,8 @@
 
         // field name cannot be null or empty
         if ((fieldName == null) || (fieldName.equals(""))) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                MODELMBEAN_LOGGER.logp(Level.FINEST,
-                        DescriptorSupport.class.getName(),
-                        "setField(fieldName,fieldValue)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                         "Illegal arguments: null or empty field name");
             }
 
@@ -555,10 +534,8 @@
         }
 
         if (!validateField(fieldName, fieldValue)) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                MODELMBEAN_LOGGER.logp(Level.FINEST,
-                        DescriptorSupport.class.getName(),
-                        "setField(fieldName,fieldValue)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                         "Illegal arguments");
             }
 
@@ -568,10 +545,8 @@
             throw new RuntimeOperationsException(iae, msg);
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "setField(fieldName,fieldValue)", "Entry: setting '"
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry: setting '"
                     + fieldName + "' to '" + fieldValue + "'");
         }
 
@@ -582,10 +557,8 @@
     }
 
     public synchronized String[] getFields() {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "getFields()", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         int numberOfEntries = descriptorMap.size();
 
@@ -594,20 +567,18 @@
 
         int i = 0;
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "getFields()", "Returning " + numberOfEntries + " fields");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Returning " + numberOfEntries + " fields");
         }
         for (Iterator<Map.Entry<String, Object>> iter = returnedSet.iterator();
              iter.hasNext(); i++) {
             Map.Entry<String, Object> currElement = iter.next();
 
             if (currElement == null) {
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINEST,
-                            DescriptorSupport.class.getName(),
-                            "getFields()", "Element is null");
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                            "Element is null");
                 }
             } else {
                 Object currValue = currElement.getValue();
@@ -626,20 +597,16 @@
             }
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "getFields()", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return responseFields;
     }
 
     public synchronized String[] getFieldNames() {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "getFieldNames()", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         int numberOfEntries = descriptorMap.size();
 
@@ -648,10 +615,8 @@
 
         int i = 0;
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "getFieldNames()",
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                     "Returning " + numberOfEntries + " fields");
         }
 
@@ -660,20 +625,16 @@
             Map.Entry<String, Object> currElement = iter.next();
 
             if (( currElement == null ) || (currElement.getKey() == null)) {
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINEST,
-                            DescriptorSupport.class.getName(),
-                            "getFieldNames()", "Field is null");
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE, "Field is null");
                 }
             } else {
                 responseFields[i] = currElement.getKey().toString();
             }
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "getFieldNames()", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return responseFields;
@@ -681,10 +642,8 @@
 
 
     public synchronized Object[] getFieldValues(String... fieldNames) {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "getFieldValues(String... fieldNames)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         // if fieldNames == null return all values
         // if fieldNames is String[0] return no values
@@ -695,10 +654,8 @@
 
         int i = 0;
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "getFieldValues(String... fieldNames)",
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                     "Returning " + numberOfEntries + " fields");
         }
 
@@ -715,10 +672,8 @@
             }
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "getFieldValues(String... fieldNames)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return responseFields;
@@ -728,18 +683,14 @@
                                        Object[] fieldValues)
             throws RuntimeOperationsException {
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "setFields(fieldNames,fieldValues)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if ((fieldNames == null) || (fieldValues == null) ||
             (fieldNames.length != fieldValues.length)) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                MODELMBEAN_LOGGER.logp(Level.FINEST,
-                        DescriptorSupport.class.getName(),
-                        "setFields(fieldNames,fieldValues)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                         "Illegal arguments");
             }
 
@@ -750,10 +701,8 @@
 
         for (int i=0; i < fieldNames.length; i++) {
             if (( fieldNames[i] == null) || (fieldNames[i].equals(""))) {
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINEST,
-                            DescriptorSupport.class.getName(),
-                            "setFields(fieldNames,fieldValues)",
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "Null field name encountered at element " + i);
                 }
                 final String msg = "fieldNames is null or invalid";
@@ -762,10 +711,8 @@
             }
             setField(fieldNames[i], fieldValues[i]);
         }
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "setFields(fieldNames,fieldValues)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
     }
 
@@ -779,10 +726,8 @@
 
     @Override
     public synchronized Object clone() throws RuntimeOperationsException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "clone()", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         return(new DescriptorSupport(this));
     }
@@ -898,20 +843,17 @@
      */
 
     public synchronized boolean isValid() throws RuntimeOperationsException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "isValid()", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         // verify that the descriptor is valid, by iterating over each field...
 
         Set<Map.Entry<String, Object>> returnedSet = descriptorMap.entrySet();
 
         if (returnedSet == null) {   // null descriptor, not valid
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                MODELMBEAN_LOGGER.logp(Level.FINEST,
-                        DescriptorSupport.class.getName(),
-                        "isValid()", "Returns false (null set)");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "isValid() Returns false (null set)");
             }
             return false;
         }
@@ -934,10 +876,8 @@
                                       (currElement.getValue()).toString())) {
                         continue;
                     } else {
-                        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                                    DescriptorSupport.class.getName(),
-                                    "isValid()",
+                        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                            MODELMBEAN_LOGGER.log(Level.TRACE,
                                     "Field " + currElement.getKey() + "=" +
                                     currElement.getValue() + " is not valid");
                         }
@@ -948,10 +888,9 @@
         }
 
         // fell through, all fields OK
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "isValid()", "Returns true");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "isValid() Returns true");
         }
         return true;
     }
@@ -1287,28 +1226,23 @@
      */
     @Override
     public synchronized String toString() {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "toString()", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         String respStr = "";
         String[] fields = getFields();
 
         if ((fields == null) || (fields.length == 0)) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-                MODELMBEAN_LOGGER.logp(Level.FINEST,
-                        DescriptorSupport.class.getName(),
-                        "toString()", "Empty Descriptor");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Empty Descriptor");
             }
             return respStr;
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "toString()", "Printing " + fields.length + " fields");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Printing " + fields.length + " fields");
         }
 
         for (int i=0; i < fields.length; i++) {
@@ -1319,10 +1253,8 @@
             }
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
-            MODELMBEAN_LOGGER.logp(Level.FINEST,
-                    DescriptorSupport.class.getName(),
-                    "toString()", "Exit returning " + respStr);
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit returning " + respStr);
         }
 
         return respStr;
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 import java.io.ObjectStreamField;
 import java.lang.reflect.Method;
 import java.security.AccessController;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 import javax.management.Descriptor;
 import javax.management.DescriptorKey;
@@ -201,12 +201,11 @@
         throws javax.management.IntrospectionException {
                 super(name, description, getter, setter);
 
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanAttributeInfo.class.getName(),
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "ModelMBeanAttributeInfo(" +
-                            "String,String,Method,Method)",
-                            "Entry", name);
+                            "String,String,Method,Method) " +
+                            "Entry " + name);
                 }
 
                 attrDescriptor = validDescriptor(null);
@@ -251,12 +250,11 @@
 
                 super(name, description, getter, setter);
                 // put getter and setter methods in operations list
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanAttributeInfo.class.getName(),
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "ModelMBeanAttributeInfo(" +
-                            "String,String,Method,Method,Descriptor)",
-                            "Entry", name);
+                            "String,String,Method,Method,Descriptor) " +
+                            "Entry " + name);
                 }
                 attrDescriptor = validDescriptor(descriptor);
         }
@@ -282,8 +280,8 @@
 
                 super(name, type, description, isReadable, isWritable, isIs);
                 // create default descriptor
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             ModelMBeanAttributeInfo.class.getName(),
                             "ModelMBeanAttributeInfo(" +
                             "String,String,String,boolean,boolean,boolean)",
@@ -321,12 +319,11 @@
                                        Descriptor descriptor)
         {
                 super(name, type, description, isReadable, isWritable, isIs);
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanAttributeInfo.class.getName(),
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "ModelMBeanAttributeInfo(String,String,String," +
-                            "boolean,boolean,boolean,Descriptor)",
-                            "Entry", name);
+                            "boolean,boolean,boolean,Descriptor)" +
+                            "Entry " + name);
                 }
                 attrDescriptor = validDescriptor(descriptor);
         }
@@ -347,10 +344,9 @@
                           inInfo.isReadable(),
                           inInfo.isWritable(),
                           inInfo.isIs());
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanAttributeInfo.class.getName(),
-                            "ModelMBeanAttributeInfo(ModelMBeanAttributeInfo)",
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                            "ModelMBeanAttributeInfo(ModelMBeanAttributeInfo) " +
                             "Entry");
                 }
                 Descriptor newDesc = inInfo.getDescriptor();
@@ -368,10 +364,8 @@
          */
 
         public Descriptor getDescriptor() {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanAttributeInfo.class.getName(),
-                        "getDescriptor()", "Entry");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
             }
                 if (attrDescriptor == null) {
                     attrDescriptor = validDescriptor(null);
@@ -411,10 +405,8 @@
         @Override
         public Object clone()
         {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanAttributeInfo.class.getName(),
-                        "clone()", "Entry");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
             }
                 return(new ModelMBeanAttributeInfo(this));
         }
@@ -454,7 +446,7 @@
             boolean defaulted = (in == null);
             if (defaulted) {
                 clone = new DescriptorSupport();
-                MODELMBEAN_LOGGER.finer("Null Descriptor, creating new.");
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Null Descriptor, creating new.");
             } else {
                 clone = (Descriptor) in.clone();
             }
@@ -462,15 +454,15 @@
             //Setting defaults.
             if (defaulted && clone.getFieldValue("name")==null) {
                 clone.setField("name", this.getName());
-                MODELMBEAN_LOGGER.finer("Defaulting Descriptor name to " + this.getName());
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor name to " + this.getName());
             }
             if (defaulted && clone.getFieldValue("descriptorType")==null) {
                 clone.setField("descriptorType", "attribute");
-                MODELMBEAN_LOGGER.finer("Defaulting descriptorType to \"attribute\"");
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting descriptorType to \"attribute\"");
             }
             if (clone.getFieldValue("displayName") == null) {
                 clone.setField("displayName",this.getName());
-                MODELMBEAN_LOGGER.finer("Defaulting Descriptor displayName to " + this.getName());
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor displayName to " + this.getName());
             }
 
             //Checking validity
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 import java.io.ObjectStreamField;
 import java.lang.reflect.Constructor;
 import java.security.AccessController;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 import javax.management.Descriptor;
 import javax.management.DescriptorAccess;
@@ -164,10 +164,9 @@
                                          Constructor<?> constructorMethod)
     {
                 super(description, constructorMethod);
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanConstructorInfo.class.getName(),
-                            "ModelMBeanConstructorInfo(String,Constructor)",
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                            "ModelMBeanConstructorInfo(String,Constructor) " +
                             "Entry");
                 }
                 consDescriptor = validDescriptor(null);
@@ -209,11 +208,10 @@
 
                 super(description, constructorMethod);
                 // put getter and setter methods in constructors list
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanConstructorInfo.class.getName(),
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "ModelMBeanConstructorInfo(" +
-                            "String,Constructor,Descriptor)", "Entry");
+                            "String,Constructor,Descriptor) Entry");
                 }
                 consDescriptor = validDescriptor(descriptor);
         }
@@ -232,11 +230,10 @@
 
                 super(name, description, signature);
                 // create default descriptor
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanConstructorInfo.class.getName(),
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "ModelMBeanConstructorInfo(" +
-                            "String,String,MBeanParameterInfo[])", "Entry");
+                            "String,String,MBeanParameterInfo[]) Entry");
                 }
                 consDescriptor = validDescriptor(null);
         }
@@ -265,11 +262,10 @@
                                          Descriptor descriptor)
         {
                 super(name, description, signature);
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanConstructorInfo.class.getName(),
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "ModelMBeanConstructorInfo(" +
-                            "String,String,MBeanParameterInfo[],Descriptor)",
+                            "String,String,MBeanParameterInfo[],Descriptor) " +
                             "Entry");
                 }
                 consDescriptor = validDescriptor(descriptor);
@@ -284,11 +280,10 @@
         ModelMBeanConstructorInfo(ModelMBeanConstructorInfo old)
         {
                 super(old.getName(), old.getDescription(), old.getSignature());
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanConstructorInfo.class.getName(),
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "ModelMBeanConstructorInfo(" +
-                            "ModelMBeanConstructorInfo)", "Entry");
+                            "ModelMBeanConstructorInfo) Entry");
                 }
                 consDescriptor = validDescriptor(consDescriptor);
         }
@@ -300,10 +295,8 @@
         @Override
         public Object clone ()
         {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanConstructorInfo.class.getName(),
-                        "clone()", "Entry");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
             }
                 return(new ModelMBeanConstructorInfo(this)) ;
         }
@@ -321,10 +314,8 @@
         @Override
         public Descriptor getDescriptor()
         {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanConstructorInfo.class.getName(),
-                        "getDescriptor()", "Entry");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
             }
             if (consDescriptor == null){
                 consDescriptor = validDescriptor(null);
@@ -356,10 +347,8 @@
         */
         public void setDescriptor(Descriptor inDescriptor)
         {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanConstructorInfo.class.getName(),
-                        "setDescriptor()", "Entry");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
             }
             consDescriptor = validDescriptor(inDescriptor);
         }
@@ -370,10 +359,8 @@
         @Override
         public String toString()
         {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanConstructorInfo.class.getName(),
-                        "toString()", "Entry");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
             }
                 String retStr =
                     "ModelMBeanConstructorInfo: " + this.getName() +
@@ -408,7 +395,7 @@
             boolean defaulted = (in == null);
             if (defaulted) {
                 clone = new DescriptorSupport();
-                MODELMBEAN_LOGGER.finer("Null Descriptor, creating new.");
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Null Descriptor, creating new.");
             } else {
                 clone = (Descriptor) in.clone();
             }
@@ -416,19 +403,19 @@
             //Setting defaults.
             if (defaulted && clone.getFieldValue("name")==null) {
                 clone.setField("name", this.getName());
-                MODELMBEAN_LOGGER.finer("Defaulting Descriptor name to " + this.getName());
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor name to " + this.getName());
             }
             if (defaulted && clone.getFieldValue("descriptorType")==null) {
                 clone.setField("descriptorType", "operation");
-                MODELMBEAN_LOGGER.finer("Defaulting descriptorType to \"operation\"");
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting descriptorType to \"operation\"");
             }
             if (clone.getFieldValue("displayName") == null) {
                 clone.setField("displayName",this.getName());
-                MODELMBEAN_LOGGER.finer("Defaulting Descriptor displayName to " + this.getName());
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor displayName to " + this.getName());
             }
             if (clone.getFieldValue("role") == null) {
                 clone.setField("role","constructor");
-                MODELMBEAN_LOGGER.finer("Defaulting Descriptor role field to \"constructor\"");
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor role field to \"constructor\"");
             }
 
             //Checking validity
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamField;
 import java.security.AccessController;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 import javax.management.Descriptor;
 import javax.management.MBeanAttributeInfo;
@@ -231,19 +231,16 @@
             modelMBeanDescriptor = validDescriptor(mbeandescriptor);
         } catch (MBeanException mbe) {
             modelMBeanDescriptor = validDescriptor(null);
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanInfoSupport.class.getName(),
-                        "ModelMBeanInfo(ModelMBeanInfo)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "ModelMBeanInfo(ModelMBeanInfo) " +
                         "Could not get a valid modelMBeanDescriptor, " +
                         "setting a default Descriptor");
             }
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "ModelMBeanInfo(ModelMBeanInfo)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
     }
 
@@ -330,12 +327,11 @@
         modelMBeanOperations = operations;
         modelMBeanNotifications = notifications;
         modelMBeanDescriptor = validDescriptor(mbeandescriptor);
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                     "ModelMBeanInfoSupport(String,String,ModelMBeanAttributeInfo[]," +
                     "ModelMBeanConstructorInfo[],ModelMBeanOperationInfo[]," +
-                    "ModelMBeanNotificationInfo[],Descriptor)",
+                    "ModelMBeanNotificationInfo[],Descriptor) " +
                     "Exit");
         }
     }
@@ -367,10 +363,8 @@
 
     public Descriptor[] getDescriptors(String inDescriptorType)
     throws MBeanException, RuntimeOperationsException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getDescriptors(String)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if ((inDescriptorType == null) || (inDescriptorType.equals(""))) {
@@ -474,10 +468,8 @@
                     " the descriptors of the MBean";
             throw new RuntimeOperationsException(iae,msg);
         }
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getDescriptors(String)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return retList;
@@ -486,10 +478,8 @@
 
     public void setDescriptors(Descriptor[] inDescriptors)
     throws MBeanException, RuntimeOperationsException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "setDescriptors(Descriptor[])", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         if (inDescriptors==null) {
             // throw RuntimeOperationsException - invalid descriptor
@@ -504,10 +494,8 @@
         for (int j=0; j < inDescriptors.length; j++) {
             setDescriptor(inDescriptors[j],null);
         }
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "setDescriptors(Descriptor[])", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
     }
@@ -530,10 +518,8 @@
 
     public Descriptor getDescriptor(String inDescriptorName)
     throws MBeanException, RuntimeOperationsException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getDescriptor(String)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         return(getDescriptor(inDescriptorName, null));
     }
@@ -606,10 +592,8 @@
             throws MBeanException, RuntimeOperationsException {
         final String excMsg =
                 "Exception occurred trying to set the descriptors of the MBean";
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "setDescriptor(Descriptor,String)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (inDescriptor==null) {
@@ -621,10 +605,9 @@
                     (String) inDescriptor.getFieldValue("descriptorType");
 
             if (inDescriptorType == null) {
-                   MODELMBEAN_LOGGER.logp(Level.FINER,
-                                ModelMBeanInfoSupport.class.getName(),
-                                "setDescriptor(Descriptor,String)",
-                                "descriptorType null in both String parameter and Descriptor, defaulting to "+ MMB);
+                   MODELMBEAN_LOGGER.log(Level.TRACE,
+                                "descriptorType null in both String parameter " +
+                                "and Descriptor, defaulting to "+ MMB);
                 inDescriptorType = MMB;
             }
         }
@@ -632,10 +615,9 @@
         String inDescriptorName =
                 (String) inDescriptor.getFieldValue("name");
         if (inDescriptorName == null) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                                ModelMBeanInfoSupport.class.getName(),
-                                "setDescriptor(Descriptor,String)",
-                                "descriptor name null, defaulting to "+ this.getClassName());
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                                "descriptor name null, defaulting to " +
+                                this.getClassName());
             inDescriptorName = this.getClassName();
         }
         boolean found = false;
@@ -653,17 +635,14 @@
                     ModelMBeanAttributeInfo mmbai =
                             (ModelMBeanAttributeInfo) attrList[i];
                     mmbai.setDescriptor(inDescriptor);
-                    if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
+                    if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
                         StringBuilder strb = new StringBuilder()
                         .append("Setting descriptor to ").append(inDescriptor)
                         .append("\t\n local: AttributeInfo descriptor is ")
                         .append(mmbai.getDescriptor())
                         .append("\t\n modelMBeanInfo: AttributeInfo descriptor is ")
                         .append(this.getDescriptor(inDescriptorName,"attribute"));
-                        MODELMBEAN_LOGGER.logp(Level.FINER,
-                                ModelMBeanInfoSupport.class.getName(),
-                                "setDescriptor(Descriptor,String)",
-                                strb.toString());
+                        MODELMBEAN_LOGGER.log(Level.TRACE, strb::toString);
                     }
                 }
             }
@@ -720,10 +699,8 @@
                     "; name=" + inDescriptorName);
             throw new RuntimeOperationsException(iae, excMsg);
         }
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "setDescriptor(Descriptor,String)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
     }
@@ -732,10 +709,8 @@
     public ModelMBeanAttributeInfo getAttribute(String inName)
     throws MBeanException, RuntimeOperationsException {
         ModelMBeanAttributeInfo retInfo = null;
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getAttribute(String)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         if (inName == null) {
             throw new RuntimeOperationsException(
@@ -748,7 +723,7 @@
         if (attrList != null) numAttrs = attrList.length;
 
         for (int i=0; (i < numAttrs) && (retInfo == null); i++) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
                 final StringBuilder strb = new StringBuilder()
                 .append("\t\n this.getAttributes() MBeanAttributeInfo Array ")
                 .append(i).append(":")
@@ -756,18 +731,14 @@
                 .append("\t\n this.modelMBeanAttributes MBeanAttributeInfo Array ")
                 .append(i).append(":")
                 .append(((ModelMBeanAttributeInfo)modelMBeanAttributes[i]).getDescriptor());
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanInfoSupport.class.getName(),
-                        "getAttribute(String)", strb.toString());
+                MODELMBEAN_LOGGER.log(Level.TRACE, strb::toString);
             }
             if (inName.equals(attrList[i].getName())) {
                 retInfo = ((ModelMBeanAttributeInfo)attrList[i].clone());
             }
         }
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getAttribute(String)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return retInfo;
@@ -778,10 +749,8 @@
     public ModelMBeanOperationInfo getOperation(String inName)
     throws MBeanException, RuntimeOperationsException {
         ModelMBeanOperationInfo retInfo = null;
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getOperation(String)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         if (inName == null) {
             throw new RuntimeOperationsException(
@@ -798,10 +767,8 @@
                 retInfo = ((ModelMBeanOperationInfo) operList[i].clone());
             }
         }
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getOperation(String)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return retInfo;
@@ -824,10 +791,8 @@
     public ModelMBeanConstructorInfo getConstructor(String inName)
     throws MBeanException, RuntimeOperationsException {
         ModelMBeanConstructorInfo retInfo = null;
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getConstructor(String)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         if (inName == null) {
             throw new RuntimeOperationsException(
@@ -844,10 +809,8 @@
                 retInfo = ((ModelMBeanConstructorInfo) consList[i].clone());
             }
         }
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getConstructor(String)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return retInfo;
@@ -857,10 +820,8 @@
     public ModelMBeanNotificationInfo getNotification(String inName)
     throws MBeanException, RuntimeOperationsException {
         ModelMBeanNotificationInfo retInfo = null;
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getNotification(String)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         if (inName == null) {
             throw new RuntimeOperationsException(
@@ -877,10 +838,8 @@
                 retInfo = ((ModelMBeanNotificationInfo) notifList[i].clone());
             }
         }
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getNotification(String)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return retInfo;
@@ -901,19 +860,15 @@
     }
 
     private Descriptor getMBeanDescriptorNoException() {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getMBeanDescriptorNoException()", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (modelMBeanDescriptor == null)
             modelMBeanDescriptor = validDescriptor(null);
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "getMBeanDescriptorNoException()",
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                     "Exit, returning: " + modelMBeanDescriptor);
         }
         return (Descriptor) modelMBeanDescriptor.clone();
@@ -921,10 +876,8 @@
 
     public void setMBeanDescriptor(Descriptor inMBeanDescriptor)
     throws MBeanException, RuntimeOperationsException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanInfoSupport.class.getName(),
-                    "setMBeanDescriptor(Descriptor)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         modelMBeanDescriptor = validDescriptor(inMBeanDescriptor);
     }
@@ -948,7 +901,7 @@
         boolean defaulted = (in == null);
         if (defaulted) {
             clone = new DescriptorSupport();
-            MODELMBEAN_LOGGER.finer("Null Descriptor, creating new.");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Null Descriptor, creating new.");
         } else {
             clone = (Descriptor) in.clone();
         }
@@ -956,27 +909,27 @@
         //Setting defaults.
         if (defaulted && clone.getFieldValue("name")==null) {
             clone.setField("name", this.getClassName());
-            MODELMBEAN_LOGGER.finer("Defaulting Descriptor name to " + this.getClassName());
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor name to " + this.getClassName());
         }
         if (defaulted && clone.getFieldValue("descriptorType")==null) {
             clone.setField("descriptorType", MMB);
-            MODELMBEAN_LOGGER.finer("Defaulting descriptorType to \"" + MMB + "\"");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting descriptorType to \"" + MMB + "\"");
         }
         if (clone.getFieldValue("displayName") == null) {
             clone.setField("displayName",this.getClassName());
-            MODELMBEAN_LOGGER.finer("Defaulting Descriptor displayName to " + this.getClassName());
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor displayName to " + this.getClassName());
         }
         if (clone.getFieldValue("persistPolicy") == null) {
             clone.setField("persistPolicy","never");
-            MODELMBEAN_LOGGER.finer("Defaulting Descriptor persistPolicy to \"never\"");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor persistPolicy to \"never\"");
         }
         if (clone.getFieldValue("log") == null) {
             clone.setField("log","F");
-            MODELMBEAN_LOGGER.finer("Defaulting Descriptor \"log\" field to \"F\"");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor \"log\" field to \"F\"");
         }
         if (clone.getFieldValue("visibility") == null) {
             clone.setField("visibility","1");
-            MODELMBEAN_LOGGER.finer("Defaulting Descriptor visibility to 1");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor visibility to 1");
         }
 
         //Checking validity
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamField;
 import java.security.AccessController;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 import javax.management.Descriptor;
 import javax.management.DescriptorAccess;
@@ -199,10 +199,8 @@
                                       String description,
                                       Descriptor descriptor) {
         super(notifTypes, name, description);
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanNotificationInfo.class.getName(),
-                    "ModelMBeanNotificationInfo", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         notificationDescriptor = validDescriptor(descriptor);
     }
@@ -225,10 +223,8 @@
      * duplicate of this ModelMBeanNotificationInfo.
      **/
     public Object clone () {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanNotificationInfo.class.getName(),
-                    "clone()", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         return(new ModelMBeanNotificationInfo(this));
     }
@@ -243,18 +239,15 @@
      * @see #setDescriptor
      **/
     public Descriptor getDescriptor() {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanNotificationInfo.class.getName(),
-                    "getDescriptor()", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (notificationDescriptor == null) {
             // Dead code. Should never happen.
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanNotificationInfo.class.getName(),
-                        "getDescriptor()", "Descriptor value is null, " +
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "Descriptor value is null, " +
                         "setting descriptor to default values");
             }
             notificationDescriptor = validDescriptor(null);
@@ -281,10 +274,8 @@
      * @see #getDescriptor
      **/
     public void setDescriptor(Descriptor inDescriptor) {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanNotificationInfo.class.getName(),
-                    "setDescriptor(Descriptor)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         notificationDescriptor = validDescriptor(inDescriptor);
     }
@@ -296,10 +287,8 @@
      * @return a string describing this object.
      **/
     public String toString() {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    ModelMBeanNotificationInfo.class.getName(),
-                    "toString()", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         final StringBuilder retStr = new StringBuilder();
@@ -342,7 +331,7 @@
         boolean defaulted = (in == null);
         if (defaulted) {
             clone = new DescriptorSupport();
-            MODELMBEAN_LOGGER.finer("Null Descriptor, creating new.");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Null Descriptor, creating new.");
         } else {
             clone = (Descriptor) in.clone();
         }
@@ -350,19 +339,19 @@
         //Setting defaults.
         if (defaulted && clone.getFieldValue("name")==null) {
             clone.setField("name", this.getName());
-            MODELMBEAN_LOGGER.finer("Defaulting Descriptor name to " + this.getName());
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor name to " + this.getName());
         }
         if (defaulted && clone.getFieldValue("descriptorType")==null) {
             clone.setField("descriptorType", "notification");
-            MODELMBEAN_LOGGER.finer("Defaulting descriptorType to \"notification\"");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting descriptorType to \"notification\"");
         }
         if (clone.getFieldValue("displayName") == null) {
             clone.setField("displayName",this.getName());
-            MODELMBEAN_LOGGER.finer("Defaulting Descriptor displayName to " + this.getName());
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor displayName to " + this.getName());
         }
         if (clone.getFieldValue("severity") == null) {
             clone.setField("severity", "6");
-            MODELMBEAN_LOGGER.finer("Defaulting Descriptor severity field to 6");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor severity field to 6");
         }
 
         //Checking validity
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 import java.io.ObjectStreamField;
 import java.lang.reflect.Method;
 import java.security.AccessController;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 import javax.management.Descriptor;
 import javax.management.DescriptorAccess;
@@ -185,10 +185,9 @@
         {
                 super(description, operationMethod);
                 // create default descriptor
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanOperationInfo.class.getName(),
-                            "ModelMBeanOperationInfo(String,Method)",
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                            "ModelMBeanOperationInfo(String,Method) " +
                             "Entry");
                 }
                 operationDescriptor = validDescriptor(null);
@@ -228,11 +227,10 @@
         {
 
                 super(description, operationMethod);
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanOperationInfo.class.getName(),
-                            "ModelMBeanOperationInfo(String,Method,Descriptor)",
-                            "Entry");
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                            "ModelMBeanOperationInfo(String,Method,Descriptor) "
+                            + "Entry");
                 }
                 operationDescriptor = validDescriptor(descriptor);
         }
@@ -258,11 +256,10 @@
 
                 super(name, description, signature, type, impact);
                 // create default descriptor
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanOperationInfo.class.getName(),
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "ModelMBeanOperationInfo(" +
-                            "String,String,MBeanParameterInfo[],String,int)",
+                            "String,String,MBeanParameterInfo[],String,int) " +
                             "Entry");
                 }
                 operationDescriptor = validDescriptor(null);
@@ -302,11 +299,10 @@
                                        Descriptor descriptor)
         {
                 super(name, description, signature, type, impact);
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanOperationInfo.class.getName(),
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "ModelMBeanOperationInfo(String,String," +
-                            "MBeanParameterInfo[],String,int,Descriptor)",
+                            "MBeanParameterInfo[],String,int,Descriptor) " +
                             "Entry");
                 }
                 operationDescriptor = validDescriptor(descriptor);
@@ -327,10 +323,9 @@
                           inInfo.getSignature(),
                           inInfo.getReturnType(),
                           inInfo.getImpact());
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            ModelMBeanOperationInfo.class.getName(),
-                            "ModelMBeanOperationInfo(ModelMBeanOperationInfo)",
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                            "ModelMBeanOperationInfo(ModelMBeanOperationInfo)" +
                             "Entry");
                 }
                 Descriptor newDesc = inInfo.getDescriptor();
@@ -345,10 +340,8 @@
 
         public Object clone ()
         {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanOperationInfo.class.getName(),
-                        "clone()", "Entry");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
             }
                 return(new ModelMBeanOperationInfo(this)) ;
         }
@@ -365,10 +358,8 @@
 
         public Descriptor getDescriptor()
         {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanOperationInfo.class.getName(),
-                        "getDescriptor()", "Entry");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
             }
             if (operationDescriptor == null) {
                 operationDescriptor = validDescriptor(null);
@@ -396,10 +387,8 @@
          */
         public void setDescriptor(Descriptor inDescriptor)
         {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanOperationInfo.class.getName(),
-                        "setDescriptor(Descriptor)", "Entry");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
             }
             operationDescriptor = validDescriptor(inDescriptor);
         }
@@ -410,10 +399,8 @@
         */
         public String toString()
         {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        ModelMBeanOperationInfo.class.getName(),
-                        "toString()", "Entry");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
             }
                 String retStr =
                     "ModelMBeanOperationInfo: " + this.getName() +
@@ -449,7 +436,7 @@
             boolean defaulted = (in == null);
             if (defaulted) {
                 clone = new DescriptorSupport();
-                MODELMBEAN_LOGGER.finer("Null Descriptor, creating new.");
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Null Descriptor, creating new.");
             } else {
                 clone = (Descriptor) in.clone();
             }
@@ -457,19 +444,19 @@
             //Setting defaults.
             if (defaulted && clone.getFieldValue("name")==null) {
                 clone.setField("name", this.getName());
-                MODELMBEAN_LOGGER.finer("Defaulting Descriptor name to " + this.getName());
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor name to " + this.getName());
             }
             if (defaulted && clone.getFieldValue("descriptorType")==null) {
                 clone.setField("descriptorType", "operation");
-                MODELMBEAN_LOGGER.finer("Defaulting descriptorType to \"operation\"");
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting descriptorType to \"operation\"");
             }
             if (clone.getFieldValue("displayName") == null) {
                 clone.setField("displayName",this.getName());
-                MODELMBEAN_LOGGER.finer("Defaulting Descriptor displayName to " + this.getName());
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor displayName to " + this.getName());
             }
             if (clone.getFieldValue("role") == null) {
                 clone.setField("role","operation");
-                MODELMBEAN_LOGGER.finer("Defaulting Descriptor role field to \"operation\"");
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Defaulting Descriptor role field to \"operation\"");
             }
 
             //Checking validity
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import java.util.Map;
 import java.util.Set;
 
@@ -166,16 +166,12 @@
      **/
     public RequiredModelMBean()
         throws MBeanException, RuntimeOperationsException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                    "RequiredModelMBean()", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         modelMBeanInfo = createDefaultModelMBeanInfo();
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                    "RequiredModelMBean()", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
     }
 
@@ -202,17 +198,13 @@
     public RequiredModelMBean(ModelMBeanInfo mbi)
         throws MBeanException, RuntimeOperationsException {
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                    "RequiredModelMBean(MBeanInfo)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
         setModelMBeanInfo(mbi);
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                    "RequiredModelMBean(MBeanInfo)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
     }
 
@@ -257,17 +249,13 @@
     public void setModelMBeanInfo(ModelMBeanInfo mbi)
         throws MBeanException, RuntimeOperationsException {
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "setModelMBeanInfo(ModelMBeanInfo)","Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (mbi == null) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                    "setModelMBeanInfo(ModelMBeanInfo)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                     "ModelMBeanInfo is null: Raising exception.");
             }
             final RuntimeException x = new
@@ -279,10 +267,8 @@
         }
 
         if (registered) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                    "setModelMBeanInfo(ModelMBeanInfo)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                     "RequiredMBean is registered: Raising exception.");
             }
             final String exceptionText =
@@ -293,32 +279,24 @@
             throw new RuntimeOperationsException(x,exceptionText);
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "setModelMBeanInfo(ModelMBeanInfo)",
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                 "Setting ModelMBeanInfo to " + printModelMBeanInfo(mbi));
             int noOfNotifications = 0;
             if (mbi.getNotifications() != null) {
                 noOfNotifications = mbi.getNotifications().length;
             }
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "setModelMBeanInfo(ModelMBeanInfo)",
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                 "ModelMBeanInfo notifications has " +
                 noOfNotifications + " elements");
         }
 
         modelMBeanInfo = (ModelMBeanInfo)mbi.clone();
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "setModelMBeanInfo(ModelMBeanInfo)","set mbeanInfo to: "+
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "set mbeanInfo to: "+
                  printModelMBeanInfo(modelMBeanInfo));
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "setModelMBeanInfo(ModelMBeanInfo)","Exit");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
     }
 
@@ -346,37 +324,29 @@
     public void setManagedResource(Object mr, String mr_type)
         throws MBeanException, RuntimeOperationsException,
                InstanceNotFoundException, InvalidTargetObjectTypeException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "setManagedResource(Object,String)","Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         // check that the mr_type is supported by this JMXAgent
         // only "objectReference" is supported
         if ((mr_type == null) ||
             (! mr_type.equalsIgnoreCase("objectReference"))) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                    "setManagedResource(Object,String)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                     "Managed Resource Type is not supported: " + mr_type);
             }
             throw new InvalidTargetObjectTypeException(mr_type);
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "setManagedResource(Object,String)",
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                 "Managed Resource is valid");
         }
         managedResource = mr;
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "setManagedResource(Object, String)", "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
     }
 
@@ -482,11 +452,9 @@
     private Object resolveForCacheValue(Descriptor descr)
         throws MBeanException, RuntimeOperationsException {
 
-        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.FINER);
-        final String mth = "resolveForCacheValue(Descriptor)";
+        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.TRACE);
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,"Entry");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         Object response = null;
@@ -495,25 +463,22 @@
 
         if (descr == null) {
             if (tracing) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),mth,
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                     "Input Descriptor is null");
             }
             return response;
         }
 
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                    mth, "descriptor is " + descr);
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "descriptor is " + descr);
         }
 
         final Descriptor mmbDescr = modelMBeanInfo.getMBeanDescriptor();
         if (mmbDescr == null) {
             if (tracing) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                        mth,"MBean Descriptor is null");
+                MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "MBean Descriptor is null");
             }
             //return response;
         }
@@ -538,9 +503,8 @@
 
         if (expTime != null) {
             if (tracing) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                        mth,"currencyTimeLimit: " + expTime);
+                MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "currencyTimeLimit: " + expTime);
             }
 
             // convert seconds to milliseconds for time comparison
@@ -550,8 +514,7 @@
                 returnCachedValue = false;
                 resetValue = true;
                 if (tracing) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            RequiredModelMBean.class.getName(),mth,
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                         currencyPeriod + ": never Cached");
                 }
             } else if (currencyPeriod == 0) {
@@ -559,9 +522,7 @@
                 returnCachedValue = true;
                 resetValue = false;
                 if (tracing) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            RequiredModelMBean.class.getName(),mth,
-                        "always valid Cache");
+                    MODELMBEAN_LOGGER.log(Level.TRACE, "always valid Cache");
                 }
             } else {
                 Object objtStamp =
@@ -572,8 +533,7 @@
                 else tStamp = null;
 
                 if (tracing) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            RequiredModelMBean.class.getName(),mth,
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                         "lastUpdatedTimeStamp: " + tStamp);
                 }
 
@@ -583,8 +543,7 @@
                 long lastTime = Long.parseLong(tStamp);
 
                 if (tracing) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            RequiredModelMBean.class.getName(),mth,
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                         "currencyPeriod:" + currencyPeriod +
                         " lastUpdatedTimeStamp:" + lastTime);
                 }
@@ -595,8 +554,7 @@
                     returnCachedValue = true;
                     resetValue = false;
                     if (tracing) {
-                        MODELMBEAN_LOGGER.logp(Level.FINER,
-                                RequiredModelMBean.class.getName(),mth,
+                        MODELMBEAN_LOGGER.log(Level.TRACE,
                             " timed valid Cache for " + now + " < " +
                             (lastTime + currencyPeriod));
                     }
@@ -604,16 +562,14 @@
                     returnCachedValue = false;
                     resetValue = true;
                     if (tracing) {
-                        MODELMBEAN_LOGGER.logp(Level.FINER,
-                                RequiredModelMBean.class.getName(),mth,
+                        MODELMBEAN_LOGGER.log(Level.TRACE,
                             "timed expired cache for " + now + " > " +
                             (lastTime + currencyPeriod));
                     }
                 }
             }
             if (tracing) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),mth,
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                     "returnCachedValue:" + returnCachedValue +
                     " resetValue: " + resetValue);
             }
@@ -625,17 +581,15 @@
                     response = currValue;
                     /* need to cast string cached value to type */
                     if (tracing) {
-                        MODELMBEAN_LOGGER.logp(Level.FINER,
-                                RequiredModelMBean.class.getName(),mth,
+                        MODELMBEAN_LOGGER.log(Level.TRACE,
                             "valid Cache value: " + currValue);
                     }
 
                 } else {
                     response = null;
                     if (tracing) {
-                        MODELMBEAN_LOGGER.logp(Level.FINER,
-                            RequiredModelMBean.class.getName(),
-                                mth,"no Cached value");
+                        MODELMBEAN_LOGGER.log(Level.TRACE,
+                                 "no Cached value");
                     }
                 }
             }
@@ -647,16 +601,14 @@
                 response = null;
                 modelMBeanInfo.setDescriptor(descr,null);
                 if (tracing) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                            mth,"reset cached value to null");
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "reset cached value to null");
                 }
             }
         }
 
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,"Exit");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return response;
@@ -672,31 +624,24 @@
      **/
     public MBeanInfo getMBeanInfo() {
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                    "getMBeanInfo()","Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (modelMBeanInfo == null) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                    "getMBeanInfo()","modelMBeanInfo is null");
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "modelMBeanInfo is null");
             }
             modelMBeanInfo = createDefaultModelMBeanInfo();
             //return new ModelMBeanInfo(" ", "", null, null, null, null);
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "getMBeanInfo()","ModelMBeanInfo is " +
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "ModelMBeanInfo is " +
                   modelMBeanInfo.getClassName() + " for " +
                   modelMBeanInfo.getDescription());
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "getMBeanInfo()",printModelMBeanInfo(modelMBeanInfo));
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    printModelMBeanInfo(modelMBeanInfo));
         }
 
         return((MBeanInfo) modelMBeanInfo.clone());
@@ -705,10 +650,8 @@
     private String printModelMBeanInfo(ModelMBeanInfo info) {
         final StringBuilder retStr = new StringBuilder();
         if (info == null) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                        "printModelMBeanInfo(ModelMBeanInfo)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                         "ModelMBeanInfo to print is null, " +
                         "printing local ModelMBeanInfo");
             }
@@ -909,12 +852,10 @@
     public Object invoke(String opName, Object[] opArgs, String[] sig)
             throws MBeanException, ReflectionException {
 
-        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.FINER);
-        final String mth = "invoke(String, Object[], String[])";
+        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.TRACE);
 
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(), mth, "Entry");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (opName == null) {
@@ -943,9 +884,8 @@
             opMethodName = opMethodName.substring(0,opSplitter);
 
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                    mth, "Finding operation " + opName + " as " + opMethodName);
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Finding operation " + opName + " as " + opMethodName);
         }
 
         ModelMBeanOperationInfo opInfo =
@@ -965,10 +905,7 @@
         final Object cached = resolveForCacheValue(opDescr);
         if (cached != null) {
             if (tracing) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                        mth,
-                        "Returning cached value");
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Returning cached value");
             }
             return cached;
         }
@@ -996,9 +933,8 @@
 
         final Object targetObjectField = opDescr.getFieldValue("targetObject");
         if (tracing && targetObjectField != null)
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                        mth, "Found target object in descriptor");
+                MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "Found target object in descriptor");
 
         /* Now look for the method, either in RequiredModelMBean itself
            or in the target object.  Set "method" and "targetObject"
@@ -1013,9 +949,8 @@
             targetObject = this;
         else {
             if (tracing) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                        mth, "looking for method in managedResource class");
+                MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "looking for method in managedResource class");
             }
             if (targetObjectField != null)
                 targetObject = targetObjectField;
@@ -1071,18 +1006,15 @@
         }
 
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                RequiredModelMBean.class.getName(),
-                    mth, "found " + opMethodName + ", now invoking");
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "found " + opMethodName + ", now invoking");
         }
 
         final Object result =
             invokeMethod(opName, method, targetObject, opArgs);
 
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                RequiredModelMBean.class.getName(),
-                    mth, "successfully invoked method");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "successfully invoked method");
         }
 
         if (result != null)
@@ -1095,12 +1027,11 @@
                                         String opMethodName,
                                         final String[] sig)
             throws ReflectionException {
-        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.FINER);
+        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.TRACE);
 
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                RequiredModelMBean.class.getName(),"resolveMethod",
-                  "resolving " + targetClass.getName() + "." + opMethodName);
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "resolving " + targetClass.getName() + "." + opMethodName);
         }
 
         final Class<?>[] argClasses;
@@ -1119,8 +1050,7 @@
                 public Void run() {
                     for (int i = 0; i < sig.length; i++) {
                         if (tracing) {
-                            MODELMBEAN_LOGGER.logp(Level.FINER,
-                                RequiredModelMBean.class.getName(),"resolveMethod",
+                            MODELMBEAN_LOGGER.log(Level.TRACE,
                                     "resolve type " + sig[i]);
                         }
                         argClasses[i] = (Class<?>) primitiveClassMap.get(sig[i]);
@@ -1131,9 +1061,7 @@
                                     Class.forName(sig[i], false, targetClassLoader);
                             } catch (ClassNotFoundException e) {
                                 if (tracing) {
-                                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                                            RequiredModelMBean.class.getName(),
-                                            "resolveMethod",
+                                    MODELMBEAN_LOGGER.log(Level.TRACE,
                                             "class not found");
                                 }
                                 final String msg = "Parameter class not found";
@@ -1182,12 +1110,10 @@
                                          Object targetObjectField,
                                          String opClassName,
                                          String[] sig) {
-        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.FINER);
+        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.TRACE);
 
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                RequiredModelMBean.class.getName(),
-                    "invoke(String, Object[], String[])",
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                   "looking for method in RequiredModelMBean class");
         }
 
@@ -1340,10 +1266,8 @@
 
             modelMBeanInfo.setDescriptor(opDescr,
                                          "operation");
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                        "invoke(String,Object[],Object[])",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                         "new descriptor is " + opDescr);
             }
         }
@@ -1495,12 +1419,9 @@
                 IllegalArgumentException("attributeName must not be null"),
                 "Exception occurred trying to get attribute of a " +
                 "RequiredModelMBean");
-        final String mth = "getAttribute(String)";
-        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.FINER);
+        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.TRACE);
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                mth, "Entry with " + attrName);
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry with " + attrName);
         }
 
         /* Check attributeDescriptor for getMethod */
@@ -1530,16 +1451,14 @@
 
                 /* return current cached value */
                 if (tracing) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            RequiredModelMBean.class.getName(), mth,
-                        "*** cached value is " + response);
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                            "*** cached value is " + response);
                 }
 
                 if (response == null) {
                     /* no cached value, run getMethod */
                     if (tracing) {
-                        MODELMBEAN_LOGGER.logp(Level.FINER,
-                                RequiredModelMBean.class.getName(), mth,
+                        MODELMBEAN_LOGGER.log(Level.TRACE,
                             "**** cached value is null - getting getMethod");
                     }
                     String attrGetMethod =
@@ -1548,9 +1467,8 @@
                     if (attrGetMethod != null) {
                         /* run method from operations descriptor */
                         if (tracing) {
-                            MODELMBEAN_LOGGER.logp(Level.FINER,
-                                    RequiredModelMBean.class.getName(),
-                                mth, "invoking a getMethod for " +  attrName);
+                            MODELMBEAN_LOGGER.log(Level.TRACE,
+                                "invoking a getMethod for " +  attrName);
                         }
 
                         Object getResponse =
@@ -1560,9 +1478,8 @@
                         if (getResponse != null) {
                             // error/validity check return value here
                             if (tracing) {
-                                MODELMBEAN_LOGGER.logp(Level.FINER,
-                                        RequiredModelMBean.class.getName(),
-                                        mth, "got a non-null response " +
+                                MODELMBEAN_LOGGER.log(Level.TRACE,
+                                        "got a non-null response " +
                                         "from getMethod\n");
                             }
 
@@ -1585,9 +1502,7 @@
 
                             if ((ctl != null) && !(ctl.equals("-1"))) {
                                 if (tracing) {
-                                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                                            RequiredModelMBean.class.getName(),
-                                            mth,
+                                    MODELMBEAN_LOGGER.log(Level.TRACE,
                                             "setting cached value and " +
                                             "lastUpdatedTime in descriptor");
                                 }
@@ -1600,19 +1515,15 @@
                                 modelMBeanInfo.setDescriptor(attrDescr,
                                                              "attribute");
                                 if (tracing) {
-                                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                                            RequiredModelMBean.class.getName(),
-                                        mth,"new descriptor is " +attrDescr);
-                                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                                            RequiredModelMBean.class.getName(),
-                                        mth,"AttributeInfo descriptor is " +
+                                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                                            "new descriptor is " +attrDescr);
+                                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                                            "AttributeInfo descriptor is " +
                                             attrInfo.getDescriptor());
                                     final String attStr = modelMBeanInfo.
                                         getDescriptor(attrName,"attribute").
                                             toString();
-                                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                                            RequiredModelMBean.class.getName(),
-                                            mth,
+                                    MODELMBEAN_LOGGER.log(Level.TRACE,
                                             "modelMBeanInfo: AttributeInfo " +
                                             "descriptor is " + attStr);
                                 }
@@ -1620,8 +1531,7 @@
                         } else {
                             // response was invalid or really returned null
                             if (tracing) {
-                                MODELMBEAN_LOGGER.logp(Level.FINER,
-                                        RequiredModelMBean.class.getName(), mth,
+                                MODELMBEAN_LOGGER.log(Level.TRACE,
                                     "got a null response from getMethod\n");
                             }
                             response = null;
@@ -1635,8 +1545,7 @@
                             response = attrDescr.getFieldValue("default");
                         }
                         if (tracing) {
-                            MODELMBEAN_LOGGER.logp(Level.FINER,
-                                    RequiredModelMBean.class.getName(), mth,
+                            MODELMBEAN_LOGGER.log(Level.TRACE,
                                 "could not find getMethod for " +attrName +
                                 ", returning descriptor " +qualifier + "value");
                         }
@@ -1698,9 +1607,8 @@
                                 subtype = false;
 
                                 if (tracing) {
-                                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                                            RequiredModelMBean.class.getName(),
-                                        mth, "Exception: ",e);
+                                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                                            "Exception: ", e);
                                 }
                             }
                             if (!subtype)
@@ -1708,9 +1616,8 @@
                         }
                         if (wrongType) {
                             if (tracing) {
-                                MODELMBEAN_LOGGER.logp(Level.FINER,
-                                        RequiredModelMBean.class.getName(), mth,
-                                    "Wrong response type '" + respType + "'");
+                                MODELMBEAN_LOGGER.log(Level.TRACE,
+                                     "Wrong response type '" + respType + "'");
                             }
                             // throw exception, didn't get
                             // back right attribute type
@@ -1724,8 +1631,7 @@
                 }
             } else {
                 if (tracing) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            RequiredModelMBean.class.getName(), mth,
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "getMethod failed " + attrName +
                             " not in attributeDescriptor\n");
                 }
@@ -1743,8 +1649,7 @@
             throw t;
         } catch (Exception e) {
             if (tracing) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(), mth,
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                         "getMethod failed with " + e.getMessage() +
                         " exception type " + (e.getClass()).toString());
             }
@@ -1753,8 +1658,7 @@
         }
 
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(), mth, "Exit");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return response;
@@ -1777,10 +1681,9 @@
      * @see #setAttributes(javax.management.AttributeList)
      */
     public AttributeList getAttributes(String[] attrNames)      {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-            "getAttributes(String[])","Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    RequiredModelMBean.class.getName(), "Entry");
         }
 
         if (attrNames == null)
@@ -1797,19 +1700,15 @@
             } catch (Exception e) {
                 // eat exceptions because interface doesn't have an
                 // exception on it
-                if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            RequiredModelMBean.class.getName(),
-                        "getAttributes(String[])",
+                if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "Failed to get \"" + attrNames[i] + "\": ", e);
                 }
             }
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                RequiredModelMBean.class.getName(),
-                    "getAttributes(String[])","Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return responseList;
@@ -1894,11 +1793,9 @@
     public void setAttribute(Attribute attribute)
         throws AttributeNotFoundException, InvalidAttributeValueException,
                MBeanException, ReflectionException {
-        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.FINER);
+        final boolean tracing = MODELMBEAN_LOGGER.isLoggable(Level.TRACE);
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "setAttribute()","Entry");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (attribute == null)
@@ -1958,11 +1855,9 @@
                                             attrValue.getClass().getName() +
                                                            " received.");
                     } catch (ClassNotFoundException x) {
-                        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                            MODELMBEAN_LOGGER.logp(Level.FINER,
-                                    RequiredModelMBean.class.getName(),
-                                "setAttribute(Attribute)","Class " +
-                                    attrType + " for attribute "
+                        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                            MODELMBEAN_LOGGER.log(Level.TRACE,
+                                "Class " + attrType + " for attribute "
                                 + attrName + " not found: ", x);
                         }
                     }
@@ -1996,9 +1891,7 @@
 
             if (updateCache || updateDescriptor) {
                 if (tracing) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                            "setAttribute(Attribute)",
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
                             "setting cached value of " +
                             attrName + " to " + attrValue);
                 }
@@ -2022,26 +1915,22 @@
                     .append(attrInfo.getDescriptor())
                     .append(". AttributeInfo descriptor is ")
                     .append(modelMBeanInfo.getDescriptor(attrName,"attribute"));
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            RequiredModelMBean.class.getName(),
-                            "setAttribute(Attribute)",strb.toString());
+                    MODELMBEAN_LOGGER.log(Level.TRACE, strb::toString);
                 }
 
             }
 
             if (tracing) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                "setAttribute(Attribute)","sending sendAttributeNotification");
+                MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "sending sendAttributeNotification");
             }
             sendAttributeChangeNotification(oldAttr,attribute);
 
         } else { // if descriptor ... else no descriptor
 
             if (tracing) {
-                    MODELMBEAN_LOGGER.logp(Level.FINER,
-                            RequiredModelMBean.class.getName(),
-                        "setAttribute(Attribute)","setMethod failed "+attrName+
+                    MODELMBEAN_LOGGER.log(Level.TRACE,
+                        "setMethod failed " + attrName +
                         " not in attributeDescriptor\n");
             }
 
@@ -2051,9 +1940,7 @@
         } // else no descriptor
 
         if (tracing) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "setAttribute(Attribute)", "Exit");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
     }
@@ -2076,10 +1963,8 @@
      **/
     public AttributeList setAttributes(AttributeList attributes) {
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "setAttribute(Attribute)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (attributes == null)
@@ -2118,17 +2003,13 @@
     private synchronized void writeToLog(String logFileName,
                                          String logEntry) throws Exception {
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "writeToLog(String, String)",
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                 "Notification Logging to " + logFileName + ": " + logEntry);
         }
         if ((logFileName == null) || (logEntry == null)) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                    "writeToLog(String, String)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                     "Bad input parameters, will not log this entry.");
             }
             return;
@@ -2139,17 +2020,13 @@
             PrintStream logOut = new PrintStream(fos);
             logOut.println(logEntry);
             logOut.close();
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(),
-                    "writeToLog(String, String)","Successfully opened log " +
-                        logFileName);
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
+                    "Successfully opened log " + logFileName);
             }
         } catch (Exception e) {
-            if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                        "writeToLog(String, String)",
+            if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                         "Exception " + e.toString() +
                         " trying to write to the Notification log file " +
                         logFileName);
@@ -2184,11 +2061,8 @@
                                         NotificationFilter filter,
                                         Object handback)
         throws java.lang.IllegalArgumentException {
-        final String mth = "addNotificationListener(" +
-                "NotificationListener, NotificationFilter, Object)";
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(), mth, "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (listener == null)
@@ -2200,12 +2074,10 @@
 
         generalBroadcaster.addNotificationListener(listener, filter,
                                                    handback);
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(), mth,
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE,
                     "NotificationListener added");
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                        RequiredModelMBean.class.getName(), mth, "Exit");
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
     }
 
@@ -2227,10 +2099,8 @@
             throw new ListenerNotFoundException(
                       "Notification listener is null");
 
-        final String mth="removeNotificationListener(NotificationListener)";
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-                MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(), mth, "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+                MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (generalBroadcaster == null)
@@ -2239,9 +2109,8 @@
 
 
         generalBroadcaster.removeNotificationListener(listener);
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(), mth, "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
     }
@@ -2255,12 +2124,8 @@
             throw new ListenerNotFoundException(
                       "Notification listener is null");
 
-        final String mth = "removeNotificationListener(" +
-                "NotificationListener, NotificationFilter, Object)";
-
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(), mth, "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (generalBroadcaster == null)
@@ -2271,19 +2136,16 @@
         generalBroadcaster.removeNotificationListener(listener,filter,
                                                       handback);
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(), mth, "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
     }
 
     public void sendNotification(Notification ntfyObj)
         throws MBeanException, RuntimeOperationsException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "sendNotification(Notification)", "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (ntfyObj == null)
@@ -2324,10 +2186,8 @@
                             ntfyObj.getMessage() + " Severity = " +
                             (String)ntfyDesc.getFieldValue("severity"));
                     } catch (Exception e) {
-                        if (MODELMBEAN_LOGGER.isLoggable(Level.FINE)) {
-                            MODELMBEAN_LOGGER.logp(Level.FINE,
-                                    RequiredModelMBean.class.getName(),
-                                    "sendNotification(Notification)",
+                        if (MODELMBEAN_LOGGER.isLoggable(Level.DEBUG)) {
+                            MODELMBEAN_LOGGER.log(Level.DEBUG,
                                     "Failed to log " +
                                     ntfyObj.getType() + " notification: ", e);
                         }
@@ -2339,14 +2199,10 @@
             generalBroadcaster.sendNotification(ntfyObj);
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                RequiredModelMBean.class.getName(),
-                    "sendNotification(Notification)",
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                     "sendNotification sent provided notification object");
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                RequiredModelMBean.class.getName(),
-                    "sendNotification(Notification)"," Exit");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
     }
@@ -2354,10 +2210,8 @@
 
     public void sendNotification(String ntfyText)
         throws MBeanException, RuntimeOperationsException {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "sendNotification(String)","Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (ntfyText == null)
@@ -2370,13 +2224,9 @@
         Notification myNtfyObj = new Notification("jmx.modelmbean.generic",
                                                   this, 1, ntfyText);
         sendNotification(myNtfyObj);
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "sendNotification(String)","Notification sent");
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "sendNotification(String)","Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Notification sent");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
     }
 
@@ -2456,10 +2306,8 @@
      *
      **/
     public MBeanNotificationInfo[] getNotificationInfo() {
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "getNotificationInfo()","Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         // Using hasNotification() is not optimal, but shouldn't really
@@ -2518,10 +2366,8 @@
             respInfo[offset+j] = currInfo[j];
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),
-                "getNotificationInfo()","Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
         return respInfo;
@@ -2535,12 +2381,8 @@
                                                        Object inhandback)
         throws MBeanException, RuntimeOperationsException,
                IllegalArgumentException {
-        final String mth="addAttributeChangeNotificationListener(" +
-                "NotificationListener, String, Object)";
-
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,"Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (inlistener == null)
@@ -2581,24 +2423,21 @@
             }
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
             Vector<String> enabledAttrs = currFilter.getEnabledAttributes();
             String s = (enabledAttrs.size() > 1) ?
                         "[" + enabledAttrs.firstElement() + ", ...]" :
                         enabledAttrs.toString();
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(), mth,
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                 "Set attribute change filter to " + s);
         }
 
         attributeBroadcaster.addNotificationListener(inlistener,currFilter,
                                                      inhandback);
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                     "Notification listener added for " + inAttributeName);
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,"Exit");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
     }
 
@@ -2609,12 +2448,9 @@
         if (inlistener == null) throw new
             ListenerNotFoundException("Notification listener is null");
 
-        final String mth = "removeAttributeChangeNotificationListener(" +
-                "NotificationListener, String)";
-
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,"Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
+                    RequiredModelMBean.class.getName(), "Entry");
         }
 
 
@@ -2648,21 +2484,17 @@
 
         attributeBroadcaster.removeNotificationListener(inlistener);
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,"Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
     }
 
     public void sendAttributeChangeNotification(AttributeChangeNotification
                                                 ntfyObj)
         throws MBeanException, RuntimeOperationsException {
-        final String mth = "sendAttributeChangeNotification(" +
-                "AttributeChangeNotification)";
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,"Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         if (ntfyObj == null)
@@ -2678,9 +2510,8 @@
         if (oldv == null) oldv = "null";
         if (newv == null) newv = "null";
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE,
                 "Sending AttributeChangeNotification with " +
                 ntfyObj.getAttributeName() + ntfyObj.getAttributeType() +
                 ntfyObj.getNewValue() + ntfyObj.getOldValue());
@@ -2718,9 +2549,8 @@
                            " Old value = " + oldv +
                            " New value = " + newv);
                     } catch (Exception e) {
-                        if (MODELMBEAN_LOGGER.isLoggable(Level.FINE)) {
-                            MODELMBEAN_LOGGER.logp(Level.FINE,
-                                    RequiredModelMBean.class.getName(),mth,
+                        if (MODELMBEAN_LOGGER.isLoggable(Level.DEBUG)) {
+                            MODELMBEAN_LOGGER.log(Level.DEBUG,
                                 "Failed to log " + ntfyObj.getType() +
                                     " notification: ", e);
                         }
@@ -2744,9 +2574,8 @@
                            " Old value = " + oldv +
                            " New value = " + newv);
                     } catch (Exception e) {
-                        if (MODELMBEAN_LOGGER.isLoggable(Level.FINE)) {
-                            MODELMBEAN_LOGGER.logp(Level.FINE,
-                                    RequiredModelMBean.class.getName(),mth,
+                        if (MODELMBEAN_LOGGER.isLoggable(Level.DEBUG)) {
+                            MODELMBEAN_LOGGER.log(Level.DEBUG,
                                 "Failed to log " + ntfyObj.getType() +
                                     " notification: ", e);
                         }
@@ -2768,25 +2597,17 @@
             generalBroadcaster.sendNotification(ntfyObj);
         }
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,
-                "sent notification");
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,
-                "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "sent notification");
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
     }
 
     public void sendAttributeChangeNotification(Attribute inOldVal,
                                                 Attribute inNewVal)
         throws MBeanException, RuntimeOperationsException {
-        final String mth =
-            "sendAttributeChangeNotification(Attribute, Attribute)";
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,
-                "Entry");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
         }
 
         // do we really want to do this?
@@ -2824,10 +2645,8 @@
 
         sendAttributeChangeNotification(myNtfyObj);
 
-        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
-            MODELMBEAN_LOGGER.logp(Level.FINER,
-                    RequiredModelMBean.class.getName(),mth,
-                "Exit");
+        if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
+            MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
         }
 
     }
--- a/jdk/src/java.management/share/classes/javax/management/monitor/CounterMonitor.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/monitor/CounterMonitor.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 package javax.management.monitor;
 
 import static com.sun.jmx.defaults.JmxProperties.MONITOR_LOGGER;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import javax.management.ObjectName;
 import javax.management.MBeanNotificationInfo;
 import static javax.management.monitor.Monitor.NumericalType.*;
@@ -228,8 +228,7 @@
      */
     public synchronized void start() {
         if (isActive()) {
-            MONITOR_LOGGER.logp(Level.FINER, CounterMonitor.class.getName(),
-                    "start", "the monitor is already active");
+            MONITOR_LOGGER.log(Level.TRACE, "the monitor is already active");
             return;
         }
         // Reset values.
@@ -696,7 +695,7 @@
                 }
             }
         } else {
-            if (MONITOR_LOGGER.isLoggable(Level.FINER)) {
+            if (MONITOR_LOGGER.isLoggable(Level.TRACE)) {
                 final StringBuilder strb = new StringBuilder()
                 .append("The notification:")
                 .append("\n\tNotification observed object = ")
@@ -708,8 +707,7 @@
                 .append("\n\tNotification derived gauge = ")
                 .append(o.getDerivedGauge())
                 .append("\nhas already been sent");
-                MONITOR_LOGGER.logp(Level.FINER, CounterMonitor.class.getName(),
-                        "updateNotifications", strb.toString());
+                MONITOR_LOGGER.log(Level.TRACE, strb::toString);
             }
         }
 
@@ -756,9 +754,7 @@
                         break;
                     default:
                         // Should never occur...
-                        MONITOR_LOGGER.logp(Level.FINEST,
-                                CounterMonitor.class.getName(),
-                                "updateThreshold",
+                        MONITOR_LOGGER.log(Level.TRACE,
                                 "the threshold type is invalid");
                         break;
                 }
@@ -819,8 +815,7 @@
         case LONG: o.setDerivedGauge(Long.valueOf(derived)); break;
         default:
             // Should never occur...
-            MONITOR_LOGGER.logp(Level.FINEST, CounterMonitor.class.getName(),
-                    "setDerivedGaugeWithDifference",
+            MONITOR_LOGGER.log(Level.TRACE,
                     "the threshold type is invalid");
             break;
         }
--- a/jdk/src/java.management/share/classes/javax/management/monitor/GaugeMonitor.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/monitor/GaugeMonitor.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 package javax.management.monitor;
 
 import static com.sun.jmx.defaults.JmxProperties.MONITOR_LOGGER;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import javax.management.MBeanNotificationInfo;
 import javax.management.ObjectName;
 import static javax.management.monitor.Monitor.NumericalType.*;
@@ -224,8 +224,7 @@
      */
     public synchronized void start() {
         if (isActive()) {
-            MONITOR_LOGGER.logp(Level.FINER, GaugeMonitor.class.getName(),
-                    "start", "the monitor is already active");
+            MONITOR_LOGGER.log(Level.TRACE, "the monitor is already active");
             return;
         }
         // Reset values.
@@ -664,8 +663,7 @@
             break;
         default:
             // Should never occur...
-            MONITOR_LOGGER.logp(Level.FINEST, GaugeMonitor.class.getName(),
-                    "setDerivedGaugeWithDifference",
+            MONITOR_LOGGER.log(Level.TRACE,
                     "the threshold type is invalid");
             return;
         }
@@ -698,8 +696,7 @@
             return (greater.doubleValue() >= less.doubleValue());
         default:
             // Should never occur...
-            MONITOR_LOGGER.logp(Level.FINEST, GaugeMonitor.class.getName(),
-                    "isFirstGreaterThanLast",
+            MONITOR_LOGGER.log(Level.TRACE,
                     "the threshold type is invalid");
             return false;
         }
@@ -733,8 +730,7 @@
         }
         else {
             // Should never occur...
-            MONITOR_LOGGER.logp(Level.FINEST, GaugeMonitor.class.getName(),
-                    "isFirstStrictlyGreaterThanLast",
+            MONITOR_LOGGER.log(Level.TRACE,
                     "the threshold type is invalid");
             return false;
         }
--- a/jdk/src/java.management/share/classes/javax/management/monitor/Monitor.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/monitor/Monitor.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import javax.management.AttributeNotFoundException;
 import javax.management.InstanceNotFoundException;
 import javax.management.IntrospectionException;
@@ -205,13 +205,11 @@
             try {
                 maximumPoolSizeTmp = Integer.parseInt(maximumPoolSizeStr);
             } catch (NumberFormatException e) {
-                if (MONITOR_LOGGER.isLoggable(Level.FINER)) {
-                    MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(),
-                            "<static initializer>",
+                if (MONITOR_LOGGER.isLoggable(Level.TRACE)) {
+                    MONITOR_LOGGER.log(Level.TRACE,
                             "Wrong value for " + maximumPoolSizeSysProp +
                             " system property", e);
-                    MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(),
-                            "<static initializer>",
+                    MONITOR_LOGGER.log(Level.TRACE,
                             maximumPoolSizeSysProp + " defaults to 10");
                 }
                 maximumPoolSizeTmp = 10;
@@ -391,8 +389,7 @@
     public ObjectName preRegister(MBeanServer server, ObjectName name)
         throws Exception {
 
-        MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(),
-                "preRegister(MBeanServer, ObjectName)",
+        MONITOR_LOGGER.log(Level.TRACE,
                 "initialize the reference on the MBean server");
 
         this.server = server;
@@ -419,8 +416,7 @@
      */
     public void preDeregister() throws Exception {
 
-        MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(),
-                "preDeregister()", "stop the monitor");
+        MONITOR_LOGGER.log(Level.TRACE, "stop the monitor");
 
         // Stop the Monitor.
         //
@@ -693,13 +689,11 @@
      * Starts the monitor.
      */
     void doStart() {
-            MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(),
-                "doStart()", "start the monitor");
+            MONITOR_LOGGER.log(Level.TRACE, "start the monitor");
 
         synchronized (this) {
             if (isActive()) {
-                MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(),
-                        "doStart()", "the monitor is already active");
+                MONITOR_LOGGER.log(Level.TRACE, "the monitor is already active");
                 return;
             }
 
@@ -729,13 +723,11 @@
      * Stops the monitor.
      */
     void doStop() {
-        MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(),
-                "doStop()", "stop the monitor");
+        MONITOR_LOGGER.log(Level.TRACE, "stop the monitor");
 
         synchronized (this) {
             if (!isActive()) {
-                MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(),
-                        "doStop()", "the monitor is not active");
+                MONITOR_LOGGER.log(Level.TRACE, "the monitor is not active");
                 return;
             }
 
@@ -1089,9 +1081,8 @@
         if (!isActive())
             return;
 
-        if (MONITOR_LOGGER.isLoggable(Level.FINER)) {
-            MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(),
-                    "sendNotification", "send notification: " +
+        if (MONITOR_LOGGER.isLoggable(Level.TRACE)) {
+            MONITOR_LOGGER.log(Level.TRACE, "send notification: " +
                     "\n\tNotification observed object = " + object +
                     "\n\tNotification observed attribute = " + observedAttribute +
                     "\n\tNotification derived gauge = " + derGauge);
@@ -1163,8 +1154,7 @@
                     setAlreadyNotified(
                         o, index, OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED, an);
                     msg = "The observed attribute value is null.";
-                    MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                            "monitor", msg);
+                    MONITOR_LOGGER.log(Level.TRACE, msg);
                 }
         } catch (NullPointerException np_ex) {
             if (isAlreadyNotified(o, RUNTIME_ERROR_NOTIFIED))
@@ -1176,10 +1166,8 @@
                     "The monitor must be registered in the MBean " +
                     "server or an MBeanServerConnection must be " +
                     "explicitly supplied.";
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", msg);
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", np_ex.toString());
+                MONITOR_LOGGER.log(Level.TRACE, msg);
+                MONITOR_LOGGER.log(Level.TRACE, np_ex::toString);
             }
         } catch (InstanceNotFoundException inf_ex) {
             if (isAlreadyNotified(o, OBSERVED_OBJECT_ERROR_NOTIFIED))
@@ -1191,10 +1179,8 @@
                 msg =
                     "The observed object must be accessible in " +
                     "the MBeanServerConnection.";
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", msg);
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", inf_ex.toString());
+                MONITOR_LOGGER.log(Level.TRACE, msg);
+                MONITOR_LOGGER.log(Level.TRACE, inf_ex::toString);
             }
         } catch (AttributeNotFoundException anf_ex) {
             if (isAlreadyNotified(o, OBSERVED_ATTRIBUTE_ERROR_NOTIFIED))
@@ -1206,10 +1192,8 @@
                 msg =
                     "The observed attribute must be accessible in " +
                     "the observed object.";
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", msg);
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", anf_ex.toString());
+                MONITOR_LOGGER.log(Level.TRACE, msg);
+                MONITOR_LOGGER.log(Level.TRACE, anf_ex::toString);
             }
         } catch (MBeanException mb_ex) {
             if (isAlreadyNotified(o, RUNTIME_ERROR_NOTIFIED))
@@ -1218,10 +1202,8 @@
                 notifType = RUNTIME_ERROR;
                 setAlreadyNotified(o, index, RUNTIME_ERROR_NOTIFIED, an);
                 msg = mb_ex.getMessage() == null ? "" : mb_ex.getMessage();
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", msg);
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", mb_ex.toString());
+                MONITOR_LOGGER.log(Level.TRACE, msg);
+                MONITOR_LOGGER.log(Level.TRACE, mb_ex::toString);
             }
         } catch (ReflectionException ref_ex) {
             if (isAlreadyNotified(o, RUNTIME_ERROR_NOTIFIED)) {
@@ -1230,10 +1212,8 @@
                 notifType = RUNTIME_ERROR;
                 setAlreadyNotified(o, index, RUNTIME_ERROR_NOTIFIED, an);
                 msg = ref_ex.getMessage() == null ? "" : ref_ex.getMessage();
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", msg);
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", ref_ex.toString());
+                MONITOR_LOGGER.log(Level.TRACE, msg);
+                MONITOR_LOGGER.log(Level.TRACE, ref_ex::toString);
             }
         } catch (IOException io_ex) {
             if (isAlreadyNotified(o, RUNTIME_ERROR_NOTIFIED))
@@ -1242,10 +1222,8 @@
                 notifType = RUNTIME_ERROR;
                 setAlreadyNotified(o, index, RUNTIME_ERROR_NOTIFIED, an);
                 msg = io_ex.getMessage() == null ? "" : io_ex.getMessage();
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", msg);
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", io_ex.toString());
+                MONITOR_LOGGER.log(Level.TRACE, msg);
+                MONITOR_LOGGER.log(Level.TRACE, io_ex::toString);
             }
         } catch (RuntimeException rt_ex) {
             if (isAlreadyNotified(o, RUNTIME_ERROR_NOTIFIED))
@@ -1254,10 +1232,8 @@
                 notifType = RUNTIME_ERROR;
                 setAlreadyNotified(o, index, RUNTIME_ERROR_NOTIFIED, an);
                 msg = rt_ex.getMessage() == null ? "" : rt_ex.getMessage();
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", msg);
-                MONITOR_LOGGER.logp(Level.FINEST, Monitor.class.getName(),
-                        "monitor", rt_ex.toString());
+                MONITOR_LOGGER.log(Level.TRACE, msg);
+                MONITOR_LOGGER.log(Level.TRACE, rt_ex::toString);
             }
         }
 
@@ -1297,10 +1273,8 @@
                         msg =
                             "The observed attribute value does not " +
                             "implement the Comparable interface.";
-                        MONITOR_LOGGER.logp(Level.FINEST,
-                                Monitor.class.getName(), "monitor", msg);
-                        MONITOR_LOGGER.logp(Level.FINEST,
-                                Monitor.class.getName(), "monitor", e.toString());
+                        MONITOR_LOGGER.log(Level.TRACE, msg);
+                        MONITOR_LOGGER.log(Level.TRACE, e::toString);
                     }
                 } catch (AttributeNotFoundException e) {
                     if (isAlreadyNotified(o, OBSERVED_ATTRIBUTE_ERROR_NOTIFIED))
@@ -1312,10 +1286,8 @@
                         msg =
                             "The observed attribute must be accessible in " +
                             "the observed object.";
-                        MONITOR_LOGGER.logp(Level.FINEST,
-                                Monitor.class.getName(), "monitor", msg);
-                        MONITOR_LOGGER.logp(Level.FINEST,
-                                Monitor.class.getName(), "monitor", e.toString());
+                        MONITOR_LOGGER.log(Level.TRACE, msg);
+                        MONITOR_LOGGER.log(Level.TRACE, e::toString);
                     }
                 } catch (RuntimeException e) {
                     if (isAlreadyNotified(o, RUNTIME_ERROR_NOTIFIED))
@@ -1325,10 +1297,8 @@
                         setAlreadyNotified(o, index,
                             RUNTIME_ERROR_NOTIFIED, an);
                         msg = e.getMessage() == null ? "" : e.getMessage();
-                        MONITOR_LOGGER.logp(Level.FINEST,
-                                Monitor.class.getName(), "monitor", msg);
-                        MONITOR_LOGGER.logp(Level.FINEST,
-                                Monitor.class.getName(), "monitor", e.toString());
+                        MONITOR_LOGGER.log(Level.TRACE, msg);
+                        MONITOR_LOGGER.log(Level.TRACE, e::toString);
                     }
                 }
             }
@@ -1346,8 +1316,7 @@
                         setAlreadyNotified(o, index,
                             OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED, an);
                         msg = "The observed attribute type is not valid.";
-                        MONITOR_LOGGER.logp(Level.FINEST,
-                                Monitor.class.getName(), "monitor", msg);
+                        MONITOR_LOGGER.log(Level.TRACE, msg);
                     }
                 }
             }
@@ -1363,8 +1332,7 @@
                         setAlreadyNotified(o, index,
                             THRESHOLD_ERROR_NOTIFIED, an);
                         msg = "The threshold type is not valid.";
-                        MONITOR_LOGGER.logp(Level.FINEST,
-                                Monitor.class.getName(), "monitor", msg);
+                        MONITOR_LOGGER.log(Level.TRACE, msg);
                     }
                 }
             }
@@ -1381,8 +1349,7 @@
                         notifType = RUNTIME_ERROR;
                         setAlreadyNotified(o, index,
                             RUNTIME_ERROR_NOTIFIED, an);
-                        MONITOR_LOGGER.logp(Level.FINEST,
-                                Monitor.class.getName(), "monitor", msg);
+                        MONITOR_LOGGER.log(Level.TRACE, msg);
                     }
                 }
             }
--- a/jdk/src/java.management/share/classes/javax/management/monitor/StringMonitor.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/monitor/StringMonitor.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 package javax.management.monitor;
 
 import static com.sun.jmx.defaults.JmxProperties.MONITOR_LOGGER;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import javax.management.ObjectName;
 import javax.management.MBeanNotificationInfo;
 import static javax.management.monitor.MonitorNotification.*;
@@ -151,8 +151,7 @@
      */
     public synchronized void start() {
         if (isActive()) {
-            MONITOR_LOGGER.logp(Level.FINER, StringMonitor.class.getName(),
-                    "start", "the monitor is already active");
+            MONITOR_LOGGER.log(Level.TRACE, "the monitor is already active");
             return;
         }
         // Reset values.
--- a/jdk/src/java.management/share/classes/javax/management/relation/MBeanServerNotificationFilter.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/relation/MBeanServerNotificationFilter.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
 import javax.management.ObjectName;
 
 import java.util.List;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import java.util.Vector;
 
 /**
@@ -160,14 +160,12 @@
     public MBeanServerNotificationFilter() {
 
         super();
-        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
-                "MBeanServerNotificationFilter");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         enableType(MBeanServerNotification.REGISTRATION_NOTIFICATION);
         enableType(MBeanServerNotification.UNREGISTRATION_NOTIFICATION);
 
-        RELATION_LOGGER.exiting(MBeanServerNotificationFilter.class.getName(),
-                "MBeanServerNotificationFilter");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -181,14 +179,12 @@
      */
     public synchronized void disableAllObjectNames() {
 
-        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
-                "disableAllObjectNames");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         selectedNames = new Vector<ObjectName>();
         deselectedNames = null;
 
-        RELATION_LOGGER.exiting(MBeanServerNotificationFilter.class.getName(),
-                "disableAllObjectNames");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -207,8 +203,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
-                "disableObjectName", objectName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}" + objectName);
 
         // Removes from selected ObjectNames, if present
         if (selectedNames != null) {
@@ -226,8 +221,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(MBeanServerNotificationFilter.class.getName(),
-                "disableObjectName");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -236,14 +230,12 @@
      */
     public synchronized void enableAllObjectNames() {
 
-        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
-                "enableAllObjectNames");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         selectedNames = null;
         deselectedNames = new Vector<ObjectName>();
 
-        RELATION_LOGGER.exiting(MBeanServerNotificationFilter.class.getName(),
-                "enableAllObjectNames");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -262,8 +254,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
-                "enableObjectName", objectName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", objectName);
 
         // Removes from deselected ObjectNames, if present
         if (deselectedNames != null) {
@@ -281,8 +272,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(MBeanServerNotificationFilter.class.getName(),
-                "enableObjectName");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -349,16 +339,13 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
-                "isNotificationEnabled", notif);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", notif);
 
         // Checks the type first
         String ntfType = notif.getType();
         Vector<String> enabledTypes = getEnabledTypes();
         if (!(enabledTypes.contains(ntfType))) {
-            RELATION_LOGGER.logp(Level.FINER,
-                    MBeanServerNotificationFilter.class.getName(),
-                    "isNotificationEnabled",
+            RELATION_LOGGER.log(Level.TRACE,
                     "Type not selected, exiting");
             return false;
         }
@@ -375,9 +362,7 @@
             // checks for explicit selection
             if (selectedNames.size() == 0) {
                 // All are explicitly not selected
-                RELATION_LOGGER.logp(Level.FINER,
-                        MBeanServerNotificationFilter.class.getName(),
-                        "isNotificationEnabled",
+                RELATION_LOGGER.log(Level.TRACE,
                         "No ObjectNames selected, exiting");
                 return false;
             }
@@ -385,9 +370,7 @@
             isSelectedFlg = selectedNames.contains(objName);
             if (!isSelectedFlg) {
                 // Not in the explicit selected list
-                RELATION_LOGGER.logp(Level.FINER,
-                        MBeanServerNotificationFilter.class.getName(),
-                        "isNotificationEnabled",
+                RELATION_LOGGER.log(Level.TRACE,
                         "ObjectName not in selected list, exiting");
                 return false;
             }
@@ -399,26 +382,20 @@
             if (deselectedNames == null) {
                 // All are implicitly deselected and it is not explicitly
                 // selected
-                RELATION_LOGGER.logp(Level.FINER,
-                        MBeanServerNotificationFilter.class.getName(),
-                        "isNotificationEnabled",
+                RELATION_LOGGER.log(Level.TRACE,
                         "ObjectName not selected, and all " +
                         "names deselected, exiting");
                 return false;
 
             } else if (deselectedNames.contains(objName)) {
                 // Explicitly deselected
-                RELATION_LOGGER.logp(Level.FINER,
-                        MBeanServerNotificationFilter.class.getName(),
-                        "isNotificationEnabled",
+                RELATION_LOGGER.log(Level.TRACE,
                         "ObjectName explicitly not selected, exiting");
                 return false;
             }
         }
 
-        RELATION_LOGGER.logp(Level.FINER,
-                MBeanServerNotificationFilter.class.getName(),
-                "isNotificationEnabled",
+        RELATION_LOGGER.log(Level.TRACE,
                 "ObjectName selected, exiting");
         return true;
     }
--- a/jdk/src/java.management/share/classes/javax/management/relation/RelationService.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/relation/RelationService.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicLong;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 import javax.management.Attribute;
 import javax.management.AttributeNotFoundException;
@@ -157,13 +157,11 @@
      */
     public RelationService(boolean immediatePurgeFlag) {
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "RelationService");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         setPurgeFlag(immediatePurgeFlag);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "RelationService");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -286,8 +284,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "createRelationType", relationTypeName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationTypeName);
 
         // Can throw an InvalidRelationTypeException
         RelationType relType =
@@ -295,8 +292,7 @@
 
         addRelationTypeInt(relType);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "createRelationType");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -325,8 +321,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "addRelationType");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         // Checks the role infos
         List<RoleInfo> roleInfoList = relationTypeObj.getRoleInfos();
@@ -346,8 +341,7 @@
 
         addRelationTypeInt(relationTypeObj);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "addRelationType");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
      }
 
@@ -385,14 +379,12 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "getRoleInfos", relationTypeName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationTypeName);
 
         // Can throw a RelationTypeNotFoundException
         RelationType relType = getRelationType(relationTypeName);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "getRoleInfos");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return relType.getRoleInfos();
     }
 
@@ -421,8 +413,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "getRoleInfo", new Object[] {relationTypeName, roleInfoName});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1}",
+                            relationTypeName, roleInfoName);
 
         // Can throw a RelationTypeNotFoundException
         RelationType relType = getRelationType(relationTypeName);
@@ -430,8 +422,7 @@
         // Can throw a RoleInfoNotFoundException
         RoleInfo roleInfo = relType.getRoleInfo(roleInfoName);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "getRoleInfo");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return roleInfo;
     }
 
@@ -461,8 +452,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "removeRelationType", relationTypeName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationTypeName);
 
         // Checks if the relation type to be removed exists
         // Can throw a RelationTypeNotFoundException
@@ -504,8 +494,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "removeRelationType");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -566,9 +555,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "createRelation",
-                new Object[] {relationId, relationTypeName, roleList});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2}",
+                            relationId, relationTypeName, roleList);
 
         // Creates RelationSupport object
         // Can throw InvalidRoleValueException
@@ -588,8 +576,7 @@
                        relationId,
                        relationTypeName,
                        roleList);
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "createRelation");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -654,8 +641,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "addRelation", relationObjectName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationObjectName);
 
         // Can throw RelationServiceNotRegisteredException
         isActive();
@@ -791,8 +777,7 @@
         newRefList.add(relationObjectName);
         updateUnregistrationListener(newRefList, null);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "addRelation");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -819,8 +804,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "isRelationMBean", relationId);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationId);
 
         // Can throw RelationNotFoundException
         Object result = getRelation(relationId);
@@ -850,8 +834,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "isRelation", objectName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", objectName);
 
         String result = null;
         synchronized(myRelMBeanObjName2RelIdMap) {
@@ -881,8 +864,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "hasRelation", relationId);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationId);
 
         try {
             // Can throw RelationNotFoundException
@@ -933,8 +915,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "checkRoleReading", new Object[] {roleName, relationTypeName});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1}",
+                            roleName, relationTypeName);
 
         Integer result;
 
@@ -956,8 +938,7 @@
             result = Integer.valueOf(RoleStatus.NO_ROLE_WITH_NAME);
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "checkRoleReading");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -995,9 +976,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "checkRoleWriting",
-                new Object[] {role, relationTypeName, initFlag});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2}",
+                            role, relationTypeName, initFlag);
 
         // Can throw a RelationTypeNotFoundException
         RelationType relType = getRelationType(relationTypeName);
@@ -1013,8 +993,7 @@
         try {
             roleInfo = relType.getRoleInfo(roleName);
         } catch (RoleInfoNotFoundException exc) {
-            RELATION_LOGGER.exiting(RelationService.class.getName(),
-                    "checkRoleWriting");
+            RELATION_LOGGER.log(Level.TRACE, "RETURN");
             return Integer.valueOf(RoleStatus.NO_ROLE_WITH_NAME);
         }
 
@@ -1024,8 +1003,7 @@
                                       roleInfo,
                                       writeChkFlag);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "checkRoleWriting");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -1055,8 +1033,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "sendRelationCreationNotification", relationId);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationId);
 
         // Message
         StringBuilder ntfMsg = new StringBuilder("Creation of relation ");
@@ -1071,8 +1048,7 @@
                             null,
                             null);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "sendRelationCreationNotification");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -1114,9 +1090,8 @@
         if (!(oldValue instanceof ArrayList<?>))
             oldValue = new ArrayList<ObjectName>(oldValue);
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "sendRoleUpdateNotification",
-                new Object[] {relationId, newRole, oldValue});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2}",
+                            relationId, newRole, oldValue);
 
         String roleName = newRole.getRoleName();
         List<ObjectName> newRoleVal = newRole.getRoleValue();
@@ -1140,8 +1115,7 @@
                             newRoleVal,
                             oldValue);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "sendRoleUpdateNotification");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
     }
 
     /**
@@ -1172,9 +1146,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "sendRelationRemovalNotification",
-                new Object[] {relationId, unregMBeanList});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1}",
+                            relationId, unregMBeanList);
 
         // Can throw RelationNotFoundException
         sendNotificationInt(3,
@@ -1186,8 +1159,7 @@
                             null);
 
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "sendRelationRemovalNotification");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -1226,8 +1198,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "updateRoleMap", new Object[] {relationId, newRole, oldValue});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2}",
+                            relationId, newRole, oldValue);
 
         // Can throw RelationServiceNotRegisteredException
         isActive();
@@ -1303,8 +1275,7 @@
         // all ObjectNames of interest
         updateUnregistrationListener(newRefList, obsRefList);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "updateRoleMap");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -1338,8 +1309,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "removeRelation", relationId);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationId);
 
         // Checks there is a relation with this id
         // Can throw RelationNotFoundException
@@ -1442,8 +1412,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "removeRelation");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -1476,8 +1445,7 @@
     public void purgeRelations()
         throws RelationServiceNotRegisteredException {
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "purgeRelations");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         // Can throw RelationServiceNotRegisteredException
         isActive();
@@ -1574,8 +1542,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "purgeRelations");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -1610,9 +1577,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "findReferencingRelations",
-                new Object[] {mbeanName, relationTypeName, roleName});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2}",
+                            mbeanName, relationTypeName, roleName);
 
         Map<String,List<String>> result = new HashMap<String,List<String>>();
 
@@ -1684,8 +1650,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "findReferencingRelations");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -1720,9 +1685,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "findAssociatedMBeans",
-                new Object[] {mbeanName, relationTypeName, roleName});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2}",
+                            mbeanName, relationTypeName, roleName);
 
         // Retrieves the map <relation id> -> <role names> for those
         // criterias
@@ -1769,8 +1733,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "findAssociatedMBeans");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -1794,8 +1757,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "findRelationsOfType");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         // Can throw RelationTypeNotFoundException
         RelationType relType = getRelationType(relationTypeName);
@@ -1809,8 +1771,7 @@
                 result = new ArrayList<String>(result1);
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "findRelationsOfType");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -1845,8 +1806,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "getRole", new Object[] {relationId, roleName});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1}",
+                            relationId, roleName);
 
         // Can throw RelationServiceNotRegisteredException
         isActive();
@@ -1899,7 +1860,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(), "getRole");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -1931,8 +1892,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "getRoles", relationId);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationId);
 
         // Can throw RelationServiceNotRegisteredException
         isActive();
@@ -1976,7 +1936,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(), "getRoles");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -2004,8 +1964,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "getRoles", relationId);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationId);
 
         // Can throw a RelationNotFoundException
         Object relObj = getRelation(relationId);
@@ -2028,7 +1987,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(), "getRoles");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -2055,8 +2014,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "getRoleCardinality", new Object[] {relationId, roleName});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1}",
+                            relationId, roleName);
 
         // Can throw a RelationNotFoundException
         Object relObj = getRelation(relationId);
@@ -2098,8 +2057,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "getRoleCardinality");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -2147,8 +2105,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "setRole", new Object[] {relationId, role});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1}",
+                            relationId, role);
 
         // Can throw RelationServiceNotRegisteredException
         isActive();
@@ -2211,7 +2169,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(), "setRole");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -2247,8 +2205,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "setRoles", new Object[] {relationId, roleList});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1}",
+                            relationId, roleList);
 
         // Can throw RelationServiceNotRegisteredException
         isActive();
@@ -2296,7 +2254,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(), "setRoles");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -2322,8 +2280,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "getReferencedMBeans", relationId);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}",
+                            relationId);
 
         // Can throw a RelationNotFoundException
         Object relObj = getRelation(relationId);
@@ -2346,8 +2304,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "getReferencedMBeans");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -2371,8 +2328,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "getRelationTypeName", relationId);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationId);
 
         // Can throw a RelationNotFoundException
         Object relObj = getRelation(relationId);
@@ -2395,8 +2351,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "getRelationTypeName");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -2421,8 +2376,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "handleNotification", notif);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", notif);
 
         if (notif instanceof MBeanServerNotification) {
 
@@ -2480,8 +2434,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "handleNotification");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -2495,8 +2448,7 @@
      */
     public MBeanNotificationInfo[] getNotificationInfo() {
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "getNotificationInfo");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         String ntfClass = "javax.management.relation.RelationNotification";
 
@@ -2514,8 +2466,7 @@
         MBeanNotificationInfo ntfInfo =
             new MBeanNotificationInfo(ntfTypes, ntfClass, ntfDesc);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "getNotificationInfo");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return new MBeanNotificationInfo[] {ntfInfo};
     }
 
@@ -2539,8 +2490,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "addRelationTypeInt");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         String relTypeName = relationTypeObj.getRelationTypeName();
 
@@ -2570,8 +2520,7 @@
             ((RelationTypeSupport)relationTypeObj).setRelationServiceFlag(true);
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "addRelationTypeInt");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
      }
 
@@ -2595,8 +2544,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "getRelationType", relationTypeName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationTypeName);
 
         // No null relation type accepted, so can use get()
         RelationType relType;
@@ -2611,8 +2559,7 @@
             throw new RelationTypeNotFoundException(excMsgStrB.toString());
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "getRelationType");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return relType;
     }
 
@@ -2639,8 +2586,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "getRelation", relationId);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationId);
 
         // No null relation  accepted, so can use get()
         Object rel;
@@ -2653,8 +2599,7 @@
             throw new RelationNotFoundException(excMsg);
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "getRelation");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return rel;
     }
 
@@ -2684,9 +2629,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "addNewMBeanReference",
-                new Object[] {objectName, relationId, roleName});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2}",
+                            objectName, relationId, roleName);
 
         boolean isNewFlag = false;
 
@@ -2739,8 +2683,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "addNewMBeanReference");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return isNewFlag;
     }
 
@@ -2772,9 +2715,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "removeMBeanReference",
-                new Object[] {objectName, relationId, roleName, allRolesFlag});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2} {3}",
+                            objectName, relationId, roleName, allRolesFlag);
 
         boolean noLongerRefFlag = false;
 
@@ -2790,8 +2732,7 @@
 
             if (mbeanRefMap == null) {
                 // The MBean is no longer referenced
-                RELATION_LOGGER.exiting(RelationService.class.getName(),
-                        "removeMBeanReference");
+                RELATION_LOGGER.log(Level.TRACE, "RETURN");
                 return true;
             }
 
@@ -2824,8 +2765,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "removeMBeanReference");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return noLongerRefFlag;
     }
 
@@ -2850,9 +2790,8 @@
             }
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "updateUnregistrationListener",
-                new Object[] {newRefList, obsoleteRefList});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1}",
+                            newRefList, obsoleteRefList);
 
         // Can throw RelationServiceNotRegisteredException
         isActive();
@@ -2936,8 +2875,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "updateUnregistrationListener");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -3003,9 +2941,10 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "addRelationInt", new Object[] {relationBaseFlag, relationObj,
-                relationObjName, relationId, relationTypeName, roleList});
+        RELATION_LOGGER.log(Level.TRACE,
+                            "ENTRY {0} {1} {2} {3} {4} {5}",
+                            relationBaseFlag, relationObj, relationObjName,
+                            relationId, relationTypeName, roleList);
 
         // Can throw RelationServiceNotRegisteredException
         isActive();
@@ -3144,8 +3083,7 @@
             // OK : The Relation could not be found.
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "addRelationInt");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -3185,15 +3123,13 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "checkRoleInt", new Object[] {chkType, roleName,
-                roleValue, roleInfo, writeChkFlag});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2} {3} {4}",
+                            chkType, roleName, roleValue, roleInfo, writeChkFlag);
 
         // Compares names
         String expName = roleInfo.getName();
         if (!(roleName.equals(expName))) {
-            RELATION_LOGGER.exiting(RelationService.class.getName(),
-                    "checkRoleInt");
+            RELATION_LOGGER.log(Level.TRACE, "RETURN");
             return Integer.valueOf(RoleStatus.NO_ROLE_WITH_NAME);
         }
 
@@ -3201,13 +3137,11 @@
         if (chkType == 1) {
             boolean isReadable = roleInfo.isReadable();
             if (!isReadable) {
-                RELATION_LOGGER.exiting(RelationService.class.getName(),
-                        "checkRoleInt");
+                RELATION_LOGGER.log(Level.TRACE, "RETURN");
                 return Integer.valueOf(RoleStatus.ROLE_NOT_READABLE);
             } else {
                 // End of check :)
-                RELATION_LOGGER.exiting(RelationService.class.getName(),
-                        "checkRoleInt");
+                RELATION_LOGGER.log(Level.TRACE, "RETURN");
                 return 0;
             }
         }
@@ -3216,8 +3150,7 @@
         if (writeChkFlag) {
             boolean isWritable = roleInfo.isWritable();
             if (!isWritable) {
-                RELATION_LOGGER.exiting(RelationService.class.getName(),
-                        "checkRoleInt");
+                RELATION_LOGGER.log(Level.TRACE, "RETURN");
                 return RoleStatus.ROLE_NOT_WRITABLE;
             }
         }
@@ -3227,16 +3160,14 @@
         // Checks minimum cardinality
         boolean chkMinFlag = roleInfo.checkMinDegree(refNbr);
         if (!chkMinFlag) {
-            RELATION_LOGGER.exiting(RelationService.class.getName(),
-                    "checkRoleInt");
+            RELATION_LOGGER.log(Level.TRACE, "RETURN");
             return RoleStatus.LESS_THAN_MIN_ROLE_DEGREE;
         }
 
         // Checks maximum cardinality
         boolean chkMaxFlag = roleInfo.checkMaxDegree(refNbr);
         if (!chkMaxFlag) {
-            RELATION_LOGGER.exiting(RelationService.class.getName(),
-                    "checkRoleInt");
+            RELATION_LOGGER.log(Level.TRACE, "RETURN");
             return RoleStatus.MORE_THAN_MAX_ROLE_DEGREE;
         }
 
@@ -3252,8 +3183,7 @@
 
             // Checks it is registered
             if (currObjName == null) {
-                RELATION_LOGGER.exiting(RelationService.class.getName(),
-                        "checkRoleInt");
+                RELATION_LOGGER.log(Level.TRACE, "RETURN");
                 return RoleStatus.REF_MBEAN_NOT_REGISTERED;
             }
 
@@ -3263,20 +3193,17 @@
                 boolean classSts = myMBeanServer.isInstanceOf(currObjName,
                                                               expClassName);
                 if (!classSts) {
-                    RELATION_LOGGER.exiting(RelationService.class.getName(),
-                            "checkRoleInt");
+                    RELATION_LOGGER.log(Level.TRACE, "RETURN");
                     return RoleStatus.REF_MBEAN_OF_INCORRECT_CLASS;
                 }
 
             } catch (InstanceNotFoundException exc) {
-                RELATION_LOGGER.exiting(RelationService.class.getName(),
-                        "checkRoleInt");
+                RELATION_LOGGER.log(Level.TRACE, "RETURN");
                 return RoleStatus.REF_MBEAN_NOT_REGISTERED;
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "checkRoleInt");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return 0;
     }
 
@@ -3328,10 +3255,9 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "initializeMissingRoles", new Object[] {relationBaseFlag,
-                relationObj, relationObjName, relationId, relationTypeName,
-                roleInfoList});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2} {3} {4} {5}",
+                            relationBaseFlag, relationObj, relationObjName,
+                            relationId, relationTypeName, roleInfoList);
 
         // Can throw RelationServiceNotRegisteredException
         isActive();
@@ -3410,8 +3336,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "initializeMissingRoles");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -3528,9 +3453,9 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "sendNotificationInt", new Object[] {intNtfType, message,
-                relationId, unregMBeanList, roleName, roleNewValue, oldValue});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2} {3} {4} {5} {6}",
+                            intNtfType, message, relationId, unregMBeanList,
+                            roleName, roleNewValue, oldValue);
 
         // Relation type name
         // Note: do not use getRelationTypeName() as if it is a relation MBean
@@ -3616,8 +3541,7 @@
 
         sendNotification(ntf);
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "sendNotificationInt");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -3654,9 +3578,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationService.class.getName(),
-                "handleReferenceUnregistration",
-                new Object[] {relationId, objectName, roleNameList});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2}",
+                            relationId, objectName, roleNameList);
 
         // Can throw RelationServiceNotRegisteredException
         isActive();
@@ -3782,8 +3705,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationService.class.getName(),
-                "handleReferenceUnregistration");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 }
--- a/jdk/src/java.management/share/classes/javax/management/relation/RelationSupport.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/relation/RelationSupport.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
 
 
 
+import java.lang.System.Logger.Level;
 import java.util.ArrayList;
-
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -162,8 +162,7 @@
 
         super();
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "RelationSupport");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         // Can throw InvalidRoleValueException and IllegalArgumentException
         initMembers(relationId,
@@ -172,8 +171,7 @@
                     relationTypeName,
                     list);
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(),
-                "RelationSupport");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
     }
 
     /**
@@ -239,8 +237,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "RelationSupport");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         // Can throw InvalidRoleValueException and
         // IllegalArgumentException
@@ -250,8 +247,7 @@
                     relationTypeName,
                     list);
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(),
-                "RelationSupport");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
     }
 
     //
@@ -286,15 +282,14 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "getRole", roleName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", roleName);
 
         // Can throw RoleNotFoundException and
         // RelationServiceNotRegisteredException
         List<ObjectName> result = cast(
             getRoleInt(roleName, false, null, false));
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(), "getRole");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -324,12 +319,12 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(), "getRoles");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         // Can throw RelationServiceNotRegisteredException
         RoleResult result = getRolesInt(roleNameArray, false, null);
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(), "getRoles");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -346,8 +341,7 @@
     public RoleResult getAllRoles()
         throws RelationServiceNotRegisteredException {
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "getAllRoles");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         RoleResult result = null;
         try {
@@ -356,7 +350,7 @@
             // OK : Invalid parameters, ignore...
         }
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(), "getAllRoles");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -367,8 +361,7 @@
      */
     public RoleList retrieveAllRoles() {
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "retrieveAllRoles");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         RoleList result;
         synchronized(myRoleName2ValueMap) {
@@ -376,8 +369,7 @@
                 new RoleList(new ArrayList<Role>(myRoleName2ValueMap.values()));
         }
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(),
-                "retrieveAllRoles");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -400,8 +392,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "getRoleCardinality", roleName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", roleName);
 
         // Try to retrieve the role
         Role role;
@@ -426,8 +417,7 @@
 
         List<ObjectName> roleValue = role.getRoleValue();
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(),
-                "getRoleCardinality");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return roleValue.size();
     }
 
@@ -476,13 +466,12 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "setRole", role);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", role);
 
         // Will return null :)
         Object result = setRoleInt(role, false, null, false);
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(), "setRole");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -521,12 +510,11 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "setRoles", list);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", list);
 
         RoleResult result = setRolesInt(list, false, null);
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(), "setRoles");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -570,9 +558,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "handleMBeanUnregistration",
-                new Object[]{objectName, roleName});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1}", objectName, roleName);
 
         // Can throw RoleNotFoundException, InvalidRoleValueException,
         // or RelationTypeNotFoundException
@@ -581,8 +567,7 @@
                                      false,
                                      null);
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(),
-                "handleMBeanUnregistration");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -594,8 +579,7 @@
      */
     public Map<ObjectName,List<String>> getReferencedMBeans() {
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "getReferencedMBeans");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         Map<ObjectName,List<String>> refMBeanMap =
             new HashMap<ObjectName,List<String>>();
@@ -628,8 +612,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(),
-                "getReferencedMBeans");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return refMBeanMap;
     }
 
@@ -779,8 +762,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "getRoleInt", roleName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", roleName);
 
         int pbType = 0;
 
@@ -885,7 +867,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(), "getRoleInt");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -921,8 +903,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "getRolesInt");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         RoleList roleList = new RoleList();
         RoleUnresolvedList roleUnresList = new RoleUnresolvedList();
@@ -966,8 +947,7 @@
         }
 
         RoleResult result = new RoleResult(roleList, roleUnresList);
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(),
-                "getRolesInt");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -991,8 +971,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "getAllRolesInt");
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY");
 
         List<String> roleNameList;
         synchronized(myRoleName2ValueMap) {
@@ -1006,8 +985,7 @@
                                         relationServCallFlg,
                                         relationServ);
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(),
-                "getAllRolesInt");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -1083,9 +1061,9 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "setRoleInt", new Object[] {aRole, relationServCallFlg,
-                relationServ, multiRoleFlg});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2} {3}",
+                            aRole, relationServCallFlg, relationServ,
+                            multiRoleFlg);
 
         String roleName = aRole.getRoleName();
         int pbType = 0;
@@ -1244,7 +1222,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(), "setRoleInt");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -1286,9 +1264,9 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "sendRoleUpdateNotification", new Object[] {newRole,
-                oldRoleValue, relationServCallFlg, relationServ});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2} {3}",
+                            newRole, oldRoleValue, relationServCallFlg,
+                            relationServ);
 
         if (relationServCallFlg) {
             // Direct call to the Relation Service
@@ -1341,8 +1319,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(),
-                "sendRoleUpdateNotification");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -1383,9 +1360,9 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "updateRelationServiceMap", new Object[] {newRole,
-                oldRoleValue, relationServCallFlg, relationServ});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2} {3}",
+                            newRole, oldRoleValue, relationServCallFlg,
+                            relationServ);
 
         if (relationServCallFlg) {
             // Direct call to the Relation Service
@@ -1433,8 +1410,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(),
-                "updateRelationServiceMap");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -1484,9 +1460,8 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "setRolesInt",
-                new Object[] {list, relationServCallFlg, relationServ});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2}",
+                            list, relationServCallFlg, relationServ);
 
         RoleList roleList = new RoleList();
         RoleUnresolvedList roleUnresList = new RoleUnresolvedList();
@@ -1534,7 +1509,7 @@
 
         RoleResult result = new RoleResult(roleList, roleUnresList);
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(), "setRolesInt");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -1578,9 +1553,9 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "initMembers", new Object[] {relationId, relationServiceName,
-                relationServiceMBeanServer, relationTypeName, list});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2} {3} {4}",
+                            relationId, relationServiceName,
+                            relationServiceMBeanServer, relationTypeName, list);
 
         myRelId = relationId;
         myRelServiceName = relationServiceName;
@@ -1589,7 +1564,7 @@
         // Can throw InvalidRoleValueException
         initRoleMap(list);
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(), "initMembers");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -1608,8 +1583,7 @@
             return;
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "initRoleMap", list);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", list);
 
         synchronized(myRoleName2ValueMap) {
 
@@ -1632,7 +1606,7 @@
             }
         }
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(), "initRoleMap");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -1692,9 +1666,9 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationSupport.class.getName(),
-                "handleMBeanUnregistrationInt", new Object[] {objectName,
-                roleName, relationServCallFlg, relationServ});
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0} {1} {2} {3}",
+                            objectName, roleName, relationServCallFlg,
+                            relationServ);
 
         // Retrieves current role value
         Role role;
@@ -1723,8 +1697,7 @@
         Object result =
             setRoleInt(newRole, relationServCallFlg, relationServ, false);
 
-        RELATION_LOGGER.exiting(RelationSupport.class.getName(),
-                "handleMBeanUnregistrationInt");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
--- a/jdk/src/java.management/share/classes/javax/management/relation/RelationTypeSupport.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/relation/RelationTypeSupport.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 /**
  * A RelationTypeSupport object implements the RelationType interface.
@@ -173,15 +173,13 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationTypeSupport.class.getName(),
-                "RelationTypeSupport", relationTypeName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationTypeName);
 
         // Can throw InvalidRelationTypeException, ClassNotFoundException
         // and NotCompliantMBeanException
         initMembers(relationTypeName, roleInfoArray);
 
-        RELATION_LOGGER.exiting(RelationTypeSupport.class.getName(),
-                "RelationTypeSupport");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -199,13 +197,11 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationTypeSupport.class.getName(),
-                "RelationTypeSupport", relationTypeName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationTypeName);
 
         typeName = relationTypeName;
 
-        RELATION_LOGGER.exiting(RelationTypeSupport.class.getName(),
-                "RelationTypeSupport");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -251,8 +247,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationTypeSupport.class.getName(),
-                "getRoleInfo", roleInfoName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", roleInfoName);
 
         // No null RoleInfo allowed, so use get()
         RoleInfo result = roleName2InfoMap.get(roleInfoName);
@@ -265,8 +260,7 @@
             throw new RoleInfoNotFoundException(excMsgStrB.toString());
         }
 
-        RELATION_LOGGER.exiting(RelationTypeSupport.class.getName(),
-                "getRoleInfo");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return result;
     }
 
@@ -297,8 +291,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationTypeSupport.class.getName(),
-                "addRoleInfo", roleInfo);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", roleInfo);
 
         if (isInRelationService) {
             // Trying to update a declared relation type
@@ -319,8 +312,7 @@
 
         roleName2InfoMap.put(roleName, new RoleInfo(roleInfo));
 
-        RELATION_LOGGER.exiting(RelationTypeSupport.class.getName(),
-                "addRoleInfo");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
@@ -351,8 +343,7 @@
             throw new IllegalArgumentException(excMsg);
         }
 
-        RELATION_LOGGER.entering(RelationTypeSupport.class.getName(),
-                "initMembers", relationTypeName);
+        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationTypeName);
 
         typeName = relationTypeName;
 
@@ -366,8 +357,7 @@
                                  new RoleInfo(currRoleInfo));
         }
 
-        RELATION_LOGGER.exiting(RelationTypeSupport.class.getName(),
-                "initMembers");
+        RELATION_LOGGER.log(Level.TRACE, "RETURN");
         return;
     }
 
--- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -347,7 +347,7 @@
                   +", unwrapping parameters using classLoaderWithRepository.");
 
         values =
-            nullIsEmpty(unwrap(params, classLoaderWithRepository, Object[].class));
+            nullIsEmpty(unwrap(params, classLoaderWithRepository, Object[].class,delegationSubject));
 
         try {
             final Object params2[] =
@@ -411,7 +411,7 @@
         values = nullIsEmpty(unwrap(params,
                                     getClassLoader(loaderName),
                                     defaultClassLoader,
-                                    Object[].class));
+                                    Object[].class,delegationSubject));
 
         try {
             final Object params2[] =
@@ -522,7 +522,7 @@
                  "connectionId=" + connectionId
                  +" unwrapping query with defaultClassLoader.");
 
-        queryValue = unwrap(query, defaultContextClassLoader, QueryExp.class);
+        queryValue = unwrap(query, defaultContextClassLoader, QueryExp.class, delegationSubject);
 
         try {
             final Object params[] = new Object[] { name, queryValue };
@@ -557,7 +557,7 @@
                  "connectionId=" + connectionId
                  +" unwrapping query with defaultClassLoader.");
 
-        queryValue = unwrap(query, defaultContextClassLoader, QueryExp.class);
+        queryValue = unwrap(query, defaultContextClassLoader, QueryExp.class, delegationSubject);
 
         try {
             final Object params[] = new Object[] { name, queryValue };
@@ -707,7 +707,7 @@
         attr = unwrap(attribute,
                       getClassLoaderFor(name),
                       defaultClassLoader,
-                      Attribute.class);
+                      Attribute.class, delegationSubject);
 
         try {
             final Object params[] = new Object[] { name, attr };
@@ -758,7 +758,7 @@
             unwrap(attributes,
                    getClassLoaderFor(name),
                    defaultClassLoader,
-                   AttributeList.class);
+                   AttributeList.class, delegationSubject);
 
         try {
             final Object params[] = new Object[] { name, attrlist };
@@ -810,7 +810,7 @@
         values = nullIsEmpty(unwrap(params,
                                     getClassLoaderFor(name),
                                     defaultClassLoader,
-                                    Object[].class));
+                                    Object[].class, delegationSubject));
 
         try {
             final Object params2[] =
@@ -990,7 +990,7 @@
 
                 filterValues[i] =
                     unwrap(filters[i], targetCl, defaultClassLoader,
-                           NotificationFilter.class);
+                           NotificationFilter.class, sbjs[i]);
 
                 if (debug) logger.debug("addNotificationListener"+
                                         "(ObjectName,NotificationFilter)",
@@ -1058,7 +1058,7 @@
                  +" unwrapping filter with target extended ClassLoader.");
 
         filterValue =
-            unwrap(filter, targetCl, defaultClassLoader, NotificationFilter.class);
+            unwrap(filter, targetCl, defaultClassLoader, NotificationFilter.class, delegationSubject);
 
         if (debug) logger.debug("addNotificationListener"+
                  "(ObjectName,ObjectName,NotificationFilter,Object)",
@@ -1066,7 +1066,7 @@
                  +" unwrapping handback with target extended ClassLoader.");
 
         handbackValue =
-            unwrap(handback, targetCl, defaultClassLoader, Object.class);
+            unwrap(handback, targetCl, defaultClassLoader, Object.class, delegationSubject);
 
         try {
             final Object params[] =
@@ -1197,7 +1197,7 @@
                  +" unwrapping filter with target extended ClassLoader.");
 
         filterValue =
-            unwrap(filter, targetCl, defaultClassLoader, NotificationFilter.class);
+            unwrap(filter, targetCl, defaultClassLoader, NotificationFilter.class, delegationSubject);
 
         if (debug) logger.debug("removeNotificationListener"+
                  "(ObjectName,ObjectName,NotificationFilter,Object)",
@@ -1205,7 +1205,7 @@
                  +" unwrapping handback with target extended ClassLoader.");
 
         handbackValue =
-            unwrap(handback, targetCl, defaultClassLoader, Object.class);
+            unwrap(handback, targetCl, defaultClassLoader, Object.class, delegationSubject);
 
         try {
             final Object params[] =
@@ -1549,20 +1549,38 @@
         }
     }
 
-    private static <T> T unwrap(final MarshalledObject<?> mo,
+    private <T> T unwrap(final MarshalledObject<?> mo,
                                 final ClassLoader cl,
-                                final Class<T> wrappedClass)
+                                final Class<T> wrappedClass,
+                                Subject delegationSubject)
             throws IOException {
         if (mo == null) {
             return null;
         }
         try {
             final ClassLoader old = AccessController.doPrivileged(new SetCcl(cl));
-            try {
-                return wrappedClass.cast(mo.get());
-            } catch (ClassNotFoundException cnfe) {
-                throw new UnmarshalException(cnfe.toString(), cnfe);
-            } finally {
+            try{
+                final AccessControlContext reqACC;
+                if (delegationSubject == null)
+                    reqACC = acc;
+                else {
+                    if (subject == null) {
+                        final String msg =
+                            "Subject delegation cannot be enabled unless " +
+                            "an authenticated subject is put in place";
+                        throw new SecurityException(msg);
+                    }
+                    reqACC = subjectDelegator.delegatedContext(
+                        acc, delegationSubject, removeCallerContext);
+                }
+                if(reqACC != null){
+                    return AccessController.doPrivileged(
+                            (PrivilegedExceptionAction<T>) () ->
+                                    wrappedClass.cast(mo.get()), reqACC);
+                }else{
+                    return wrappedClass.cast(mo.get());
+                }
+            }finally{
                 AccessController.doPrivileged(new SetCcl(old));
             }
         } catch (PrivilegedActionException pe) {
@@ -1575,14 +1593,19 @@
             }
             logger.warning("unwrap", "Failed to unmarshall object: " + e);
             logger.debug("unwrap", e);
+        }catch (ClassNotFoundException ex) {
+            logger.warning("unwrap", "Failed to unmarshall object: " + ex);
+            logger.debug("unwrap", ex);
+            throw new UnmarshalException(ex.toString(), ex);
         }
         return null;
     }
 
-    private static <T> T unwrap(final MarshalledObject<?> mo,
+    private <T> T unwrap(final MarshalledObject<?> mo,
                                 final ClassLoader cl1,
                                 final ClassLoader cl2,
-                                final Class<T> wrappedClass)
+                                final Class<T> wrappedClass,
+                                Subject delegationSubject)
         throws IOException {
         if (mo == null) {
             return null;
@@ -1596,7 +1619,7 @@
                     }
                 }
             );
-            return unwrap(mo, orderCL, wrappedClass);
+            return unwrap(mo, orderCL, wrappedClass,delegationSubject);
         } catch (PrivilegedActionException pe) {
             Exception e = extractException(pe);
             if (e instanceof IOException) {
--- a/jdk/src/java.management/share/classes/javax/management/timer/Timer.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/timer/Timer.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.Vector;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 
 // jmx imports
 //
@@ -221,8 +221,7 @@
      */
     public void preDeregister() throws java.lang.Exception {
 
-        TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                "preDeregister", "stop the timer");
+        TIMER_LOGGER.log(Level.TRACE, "stop the timer");
 
         // Stop the timer.
         //
@@ -273,8 +272,7 @@
      */
     public synchronized void start() {
 
-        TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                "start", "starting the timer");
+        TIMER_LOGGER.log(Level.TRACE, "starting the timer");
 
         // Start the TimerAlarmClock.
         //
@@ -323,11 +321,9 @@
             //
             isActive = true;
 
-            TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                    "start", "timer started");
+            TIMER_LOGGER.log(Level.TRACE, "timer started");
         } else {
-            TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                    "start", "the timer is already activated");
+            TIMER_LOGGER.log(Level.TRACE, "the timer is already activated");
         }
     }
 
@@ -336,8 +332,7 @@
      */
     public synchronized void stop() {
 
-        TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                "stop", "stopping the timer");
+        TIMER_LOGGER.log(Level.TRACE, "stopping the timer");
 
         // Stop the TimerAlarmClock.
         //
@@ -370,11 +365,9 @@
             //
             isActive = false;
 
-            TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                    "stop", "timer stopped");
+            TIMER_LOGGER.log(Level.TRACE, "timer stopped");
         } else {
-            TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                    "stop", "the timer is already deactivated");
+            TIMER_LOGGER.log(Level.TRACE, "the timer is already deactivated");
         }
     }
 
@@ -444,9 +437,8 @@
         if (currentDate.after(date)) {
 
             date.setTime(currentDate.getTime());
-            if (TIMER_LOGGER.isLoggable(Level.FINER)) {
-                TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                        "addNotification",
+            if (TIMER_LOGGER.isLoggable(Level.TRACE)) {
+                TIMER_LOGGER.log(Level.TRACE,
                         "update timer notification to add with:" +
                         "\n\tNotification date = " + date);
             }
@@ -486,7 +478,7 @@
         obj[ALARM_CLOCK_INDEX] = (Object)alarmClock;
         obj[FIXED_RATE_INDEX] = Boolean.valueOf(fixedRate);
 
-        if (TIMER_LOGGER.isLoggable(Level.FINER)) {
+        if (TIMER_LOGGER.isLoggable(Level.TRACE)) {
             StringBuilder strb = new StringBuilder()
             .append("adding timer notification:\n\t")
             .append("Notification source = ")
@@ -503,8 +495,7 @@
             .append(nbOccurences)
             .append("\n\tNotification executes at fixed rate = ")
             .append(fixedRate);
-            TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                    "addNotification", strb.toString());
+            TIMER_LOGGER.log(Level.TRACE, strb::toString);
         }
 
         timerTable.put(notifID, obj);
@@ -522,8 +513,7 @@
           }
         }
 
-        TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                "addNotification", "timer notification added");
+        TIMER_LOGGER.log(Level.TRACE, "timer notification added");
         return notifID;
     }
 
@@ -677,7 +667,7 @@
 
         // Remove the timer notification from the timer table.
         //
-        if (TIMER_LOGGER.isLoggable(Level.FINER)) {
+        if (TIMER_LOGGER.isLoggable(Level.TRACE)) {
             StringBuilder strb = new StringBuilder()
             .append("removing timer notification:")
             .append("\n\tNotification source = ")
@@ -694,14 +684,12 @@
             .append(obj[TIMER_NB_OCCUR_INDEX])
             .append("\n\tNotification executes at fixed rate = ")
             .append(obj[FIXED_RATE_INDEX]);
-            TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                    "removeNotification", strb.toString());
+            TIMER_LOGGER.log(Level.TRACE, strb::toString);
         }
 
         timerTable.remove(id);
 
-        TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                "removeNotification", "timer notification removed");
+        TIMER_LOGGER.log(Level.TRACE, "timer notification removed");
     }
 
     /**
@@ -752,19 +740,16 @@
         }
 
         // Remove all the timer notifications from the timer table.
-        TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                "removeAllNotifications", "removing all timer notifications");
+        TIMER_LOGGER.log(Level.TRACE, "removing all timer notifications");
 
         timerTable.clear();
 
-        TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                "removeAllNotifications", "all timer notifications removed");
+        TIMER_LOGGER.log(Level.TRACE, "all timer notifications removed");
         // Reset the counterID.
         //
         counterID = 0;
 
-        TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                "removeAllNotifications", "timer notification counter ID reset");
+        TIMER_LOGGER.log(Level.TRACE, "timer notification counter ID reset");
     }
 
     // GETTERS AND SETTERS
@@ -1021,7 +1006,7 @@
             while ( (currentDate.after(date)) && (timerTable.containsKey(notifID)) ) {
 
                 if (currentFlag == true) {
-                    if (TIMER_LOGGER.isLoggable(Level.FINER)) {
+                    if (TIMER_LOGGER.isLoggable(Level.TRACE)) {
                         StringBuilder strb = new StringBuilder()
                         .append("sending past timer notification:")
                         .append("\n\tNotification source = ")
@@ -1038,13 +1023,11 @@
                         .append(obj[TIMER_NB_OCCUR_INDEX])
                         .append("\n\tNotification executes at fixed rate = ")
                         .append(obj[FIXED_RATE_INDEX]);
-                        TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                                "sendPastNotifications", strb.toString());
+                        TIMER_LOGGER.log(Level.TRACE, strb::toString);
                     }
                     sendNotification(date, notif);
 
-                    TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                            "sendPastNotifications", "past timer notification sent");
+                    TIMER_LOGGER.log(Level.TRACE, "past timer notification sent");
                 }
 
                 // Update the date and the number of occurrences of the timer notification.
@@ -1107,7 +1090,7 @@
                     timer.schedule(alarmClock, alarmClock.timeout);
                   }
                 }
-                if (TIMER_LOGGER.isLoggable(Level.FINER)) {
+                if (TIMER_LOGGER.isLoggable(Level.TRACE)) {
                     TimerNotification notif = (TimerNotification)obj[TIMER_NOTIF_INDEX];
                     StringBuilder strb = new StringBuilder()
                     .append("update timer notification with:")
@@ -1125,8 +1108,7 @@
                     .append(nbOccurences)
                     .append("\n\tNotification executes at fixed rate = ")
                     .append(fixedRate);
-                    TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                            "updateTimerTable", strb.toString());
+                    TIMER_LOGGER.log(Level.TRACE, strb::toString);
                 }
             }
             else {
@@ -1211,7 +1193,7 @@
      */
     void sendNotification(Date timeStamp, TimerNotification notification) {
 
-        if (TIMER_LOGGER.isLoggable(Level.FINER)) {
+        if (TIMER_LOGGER.isLoggable(Level.TRACE)) {
             StringBuilder strb = new StringBuilder()
             .append("sending timer notification:")
             .append("\n\tNotification source = ")
@@ -1222,8 +1204,7 @@
             .append(notification.getNotificationID())
             .append("\n\tNotification date = ")
             .append(timeStamp);
-            TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                    "sendNotification", strb.toString());
+            TIMER_LOGGER.log(Level.TRACE, strb::toString);
         }
         long curSeqNumber;
         synchronized(this) {
@@ -1236,7 +1217,6 @@
             this.sendNotification((TimerNotification)notification.cloneTimerNotification());
         }
 
-        TIMER_LOGGER.logp(Level.FINER, Timer.class.getName(),
-                "sendNotification", "timer notification sent");
+        TIMER_LOGGER.log(Level.TRACE, "timer notification sent");
     }
 }
--- a/jdk/src/java.management/share/classes/javax/management/timer/TimerAlarmClock.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/javax/management/timer/TimerAlarmClock.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 package javax.management.timer;
 
 import java.util.Date;
-import java.util.logging.Level;
+import java.lang.System.Logger.Level;
 import static com.sun.jmx.defaults.JmxProperties.TIMER_LOGGER;
 
 /**
@@ -73,7 +73,7 @@
             TimerAlarmClockNotification notif = new TimerAlarmClockNotification(this);
             listener.notifyAlarmClock(notif);
         } catch (Exception e) {
-            TIMER_LOGGER.logp(Level.FINEST, Timer.class.getName(), "run",
+            TIMER_LOGGER.log(Level.TRACE,
                     "Got unexpected exception when sending a notification", e);
         }
     }
--- a/jdk/src/java.management/share/classes/module-info.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.management/share/classes/module-info.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,6 @@
  */
 module java.management {
     requires transitive java.rmi;
-    requires java.logging;
     requires java.naming;
 
     exports java.lang.management;
@@ -55,4 +54,3 @@
     provides javax.security.auth.spi.LoginModule
         with com.sun.jmx.remote.security.FileLoginModule;
 }
-
--- a/jdk/src/java.rmi/share/classes/java/rmi/MarshalledObject.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.rmi/share/classes/java/rmi/MarshalledObject.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,11 +29,15 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.ObjectInputFilter;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamConstants;
 import java.io.OutputStream;
 import java.io.Serializable;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 import sun.rmi.server.MarshalInputStream;
 import sun.rmi.server.MarshalOutputStream;
 
@@ -90,6 +94,9 @@
      */
     private int hash;
 
+    /** Filter used when creating the instance from a stream; may be null. */
+    private transient ObjectInputFilter objectInputFilter = null;
+
     /** Indicate compatibility with 1.2 version of class. */
     private static final long serialVersionUID = 8988374069173025854L;
 
@@ -133,9 +140,25 @@
     }
 
     /**
+     * Reads in the state of the object and saves the stream's
+     * serialization filter to be used when the object is deserialized.
+     *
+     * @param stream the stream
+     * @throws IOException if an I/O error occurs
+     * @throws ClassNotFoundException if a class cannot be found
+     */
+    private void readObject(ObjectInputStream stream)
+        throws IOException, ClassNotFoundException {
+        stream.defaultReadObject();     // read in all fields
+        objectInputFilter = stream.getObjectInputFilter();
+    }
+
+    /**
      * Returns a new copy of the contained marshalledobject.  The internal
      * representation is deserialized with the semantics used for
      * unmarshaling parameters for RMI calls.
+     * If the MarshalledObject was read from an ObjectInputStream,
+     * the filter from that stream is used to deserialize the object.
      *
      * @return a copy of the contained object
      * @exception IOException if an <code>IOException</code> occurs while
@@ -155,7 +178,7 @@
         ByteArrayInputStream lin =
             (locBytes == null ? null : new ByteArrayInputStream(locBytes));
         MarshalledObjectInputStream in =
-            new MarshalledObjectInputStream(bin, lin);
+            new MarshalledObjectInputStream(bin, lin, objectInputFilter);
         @SuppressWarnings("unchecked")
         T obj = (T) in.readObject();
         in.close();
@@ -295,11 +318,21 @@
          * <code>null</code>, then all annotations will be
          * <code>null</code>.
          */
-        MarshalledObjectInputStream(InputStream objIn, InputStream locIn)
+        MarshalledObjectInputStream(InputStream objIn, InputStream locIn,
+                    ObjectInputFilter filter)
             throws IOException
         {
             super(objIn);
             this.locIn = (locIn == null ? null : new ObjectInputStream(locIn));
+            if (filter != null) {
+                AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                    MarshalledObjectInputStream.this.setObjectInputFilter(filter);
+                    if (MarshalledObjectInputStream.this.locIn != null) {
+                        MarshalledObjectInputStream.this.locIn.setObjectInputFilter(filter);
+                    }
+                    return null;
+                });
+            }
         }
 
         /**
--- a/jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java	Sat Jan 21 03:53:21 2017 +0000
@@ -25,8 +25,12 @@
 
 package sun.rmi.registry;
 
+import java.io.ObjectInputFilter;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.rmi.server.LogStream;
+import java.security.PrivilegedAction;
+import java.security.Security;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.Hashtable;
@@ -39,7 +43,6 @@
 import java.net.*;
 import java.rmi.*;
 import java.rmi.server.ObjID;
-import java.rmi.server.RemoteServer;
 import java.rmi.server.ServerNotActiveException;
 import java.rmi.registry.Registry;
 import java.rmi.server.RMIClientSocketFactory;
@@ -54,12 +57,12 @@
 import java.security.Permissions;
 import java.security.ProtectionDomain;
 import java.text.MessageFormat;
-import sun.rmi.server.LoaderHandler;
+
+import sun.rmi.runtime.Log;
+import sun.rmi.server.UnicastRef;
 import sun.rmi.server.UnicastServerRef;
 import sun.rmi.server.UnicastServerRef2;
 import sun.rmi.transport.LiveRef;
-import sun.rmi.transport.ObjectTable;
-import sun.rmi.transport.Target;
 
 /**
  * A "registry" exists on every node that allows RMI connections to
@@ -91,6 +94,48 @@
     private static ResourceBundle resources = null;
 
     /**
+     * Property name of the RMI Registry serial filter to augment
+     * the built-in list of allowed types.
+     * Setting the property in the {@code conf/security/java.security} file
+     * will enable the augmented filter.
+     */
+    private static final String REGISTRY_FILTER_PROPNAME = "sun.rmi.registry.registryFilter";
+
+    /** Registry max depth of remote invocations. **/
+    private static int REGISTRY_MAX_DEPTH = 5;
+
+    /** Registry maximum array size in remote invocations. **/
+    private static int REGISTRY_MAX_ARRAY_SIZE = 10000;
+
+    /**
+     * The registryFilter created from the value of the {@code "sun.rmi.registry.registryFilter"}
+     * property.
+     */
+    private static final ObjectInputFilter registryFilter =
+            AccessController.doPrivileged((PrivilegedAction<ObjectInputFilter>)RegistryImpl::initRegistryFilter);
+
+    /**
+     * Initialize the registryFilter from the security properties or system property; if any
+     * @return an ObjectInputFilter, or null
+     */
+    @SuppressWarnings("deprecation")
+    private static ObjectInputFilter initRegistryFilter() {
+        ObjectInputFilter filter = null;
+        String props = System.getProperty(REGISTRY_FILTER_PROPNAME);
+        if (props == null) {
+            props = Security.getProperty(REGISTRY_FILTER_PROPNAME);
+        }
+        if (props != null) {
+            filter = ObjectInputFilter.Config.createFilter(props);
+            Log regLog = Log.getLog("sun.rmi.registry", "registry", -1);
+            if (regLog.isLoggable(Log.BRIEF)) {
+                regLog.log(Log.BRIEF, "registryFilter = " + filter);
+            }
+        }
+        return filter;
+    }
+
+    /**
      * Construct a new RegistryImpl on the specified port with the
      * given custom socket factory pair.
      */
@@ -105,7 +150,7 @@
                 AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
                     public Void run() throws RemoteException {
                         LiveRef lref = new LiveRef(id, port, csf, ssf);
-                        setup(new UnicastServerRef2(lref));
+                        setup(new UnicastServerRef2(lref, RegistryImpl::registryFilter));
                         return null;
                     }
                 }, null, new SocketPermission("localhost:"+port, "listen,accept"));
@@ -114,7 +159,7 @@
             }
         } else {
             LiveRef lref = new LiveRef(id, port, csf, ssf);
-            setup(new UnicastServerRef2(lref));
+            setup(new UnicastServerRef2(lref, RegistryImpl::registryFilter));
         }
     }
 
@@ -130,7 +175,7 @@
                 AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
                     public Void run() throws RemoteException {
                         LiveRef lref = new LiveRef(id, port);
-                        setup(new UnicastServerRef(lref));
+                        setup(new UnicastServerRef(lref, RegistryImpl::registryFilter));
                         return null;
                     }
                 }, null, new SocketPermission("localhost:"+port, "listen,accept"));
@@ -139,7 +184,7 @@
             }
         } else {
             LiveRef lref = new LiveRef(id, port);
-            setup(new UnicastServerRef(lref));
+            setup(new UnicastServerRef(lref, RegistryImpl::registryFilter));
         }
     }
 
@@ -362,6 +407,60 @@
     }
 
     /**
+     * ObjectInputFilter to filter Registry input objects.
+     * The list of acceptable classes is limited to classes normally
+     * stored in a registry.
+     *
+     * @param filterInfo access to the class, array length, etc.
+     * @return  {@link ObjectInputFilter.Status#ALLOWED} if allowed,
+     *          {@link ObjectInputFilter.Status#REJECTED} if rejected,
+     *          otherwise {@link ObjectInputFilter.Status#UNDECIDED}
+     */
+    private static ObjectInputFilter.Status registryFilter(ObjectInputFilter.FilterInfo filterInfo) {
+        if (registryFilter != null) {
+            ObjectInputFilter.Status status = registryFilter.checkInput(filterInfo);
+            if (status != ObjectInputFilter.Status.UNDECIDED) {
+                // The Registry filter can override the built-in white-list
+                return status;
+            }
+        }
+
+        if (filterInfo.depth() > REGISTRY_MAX_DEPTH) {
+            return ObjectInputFilter.Status.REJECTED;
+        }
+        Class<?> clazz = filterInfo.serialClass();
+        if (clazz != null) {
+            if (clazz.isArray()) {
+                if (filterInfo.arrayLength() >= 0 && filterInfo.arrayLength() > REGISTRY_MAX_ARRAY_SIZE) {
+                    return ObjectInputFilter.Status.REJECTED;
+                }
+                do {
+                    // Arrays are allowed depending on the component type
+                    clazz = clazz.getComponentType();
+                } while (clazz.isArray());
+            }
+            if (clazz.isPrimitive()) {
+                // Arrays of primitives are allowed
+                return ObjectInputFilter.Status.ALLOWED;
+            }
+            if (String.class == clazz
+                    || java.lang.Number.class.isAssignableFrom(clazz)
+                    || Remote.class.isAssignableFrom(clazz)
+                    || java.lang.reflect.Proxy.class.isAssignableFrom(clazz)
+                    || UnicastRef.class.isAssignableFrom(clazz)
+                    || RMIClientSocketFactory.class.isAssignableFrom(clazz)
+                    || RMIServerSocketFactory.class.isAssignableFrom(clazz)
+                    || java.rmi.activation.ActivationID.class.isAssignableFrom(clazz)
+                    || java.rmi.server.UID.class.isAssignableFrom(clazz)) {
+                return ObjectInputFilter.Status.ALLOWED;
+            } else {
+                return ObjectInputFilter.Status.REJECTED;
+            }
+        }
+        return ObjectInputFilter.Status.UNDECIDED;
+    }
+
+    /**
      * Return a new RegistryImpl on the requested port and export it to serve
      * registry requests. A classloader is initialized from the system property
      * "env.class.path" and a security manager is set unless one is already set.
--- a/jdk/src/java.rmi/share/classes/sun/rmi/runtime/Log.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/runtime/Log.java	Sat Jan 21 03:53:21 2017 +0000
@@ -232,6 +232,11 @@
             }
         }
 
+        public String toString() {
+            return logger.toString() + ", level: " + logger.getLevel() +
+                    ", name: " + logger.getName();
+        }
+
         /**
          * Set the output stream associated with the RMI server call
          * logger.
--- a/jdk/src/java.rmi/share/classes/sun/rmi/transport/DGCImpl.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/transport/DGCImpl.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
  */
 package sun.rmi.transport;
 
+import java.io.ObjectInputFilter;
 import java.net.SocketPermission;
 import java.rmi.Remote;
 import java.rmi.RemoteException;
@@ -34,11 +35,13 @@
 import java.rmi.server.ObjID;
 import java.rmi.server.RemoteServer;
 import java.rmi.server.ServerNotActiveException;
+import java.rmi.server.UID;
 import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.Permissions;
 import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
+import java.security.Security;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.HashMap;
@@ -100,6 +103,46 @@
     }
 
     /**
+     * Property name of the DGC serial filter to augment
+     * the built-in list of allowed types.
+     * Setting the property in the {@code conf/security/java.security} file
+     * or system property will enable the augmented filter.
+     */
+    private static final String DGC_FILTER_PROPNAME = "sun.rmi.transport.dgcFilter";
+
+    /** Registry max depth of remote invocations. **/
+    private static int DGC_MAX_DEPTH = 5;
+
+    /** Registry maximum array size in remote invocations. **/
+    private static int DGC_MAX_ARRAY_SIZE = 10000;
+
+    /**
+     * The dgcFilter created from the value of the {@code  "sun.rmi.transport.dgcFilter"}
+     * property.
+     */
+    private static final ObjectInputFilter dgcFilter =
+            AccessController.doPrivileged((PrivilegedAction<ObjectInputFilter>)DGCImpl::initDgcFilter);
+
+    /**
+     * Initialize the dgcFilter from the security properties or system property; if any
+     * @return an ObjectInputFilter, or null
+     */
+    private static ObjectInputFilter initDgcFilter() {
+        ObjectInputFilter filter = null;
+        String props = System.getProperty(DGC_FILTER_PROPNAME);
+        if (props == null) {
+            props = Security.getProperty(DGC_FILTER_PROPNAME);
+        }
+        if (props != null) {
+            filter = ObjectInputFilter.Config.createFilter(props);
+            if (dgcLog.isLoggable(Log.BRIEF)) {
+                dgcLog.log(Log.BRIEF, "dgcFilter = " + filter);
+            }
+        }
+        return filter;
+    }
+
+    /**
      * Construct a new server-side remote object collector at
      * a particular port. Disallow construction from outside.
      */
@@ -293,7 +336,8 @@
                         dgc = new DGCImpl();
                         ObjID dgcID = new ObjID(ObjID.DGC_ID);
                         LiveRef ref = new LiveRef(dgcID, 0);
-                        UnicastServerRef disp = new UnicastServerRef(ref);
+                        UnicastServerRef disp = new UnicastServerRef(ref,
+                                DGCImpl::checkInput);
                         Remote stub =
                             Util.createProxy(DGCImpl.class,
                                              new UnicastRef(ref), true);
@@ -324,6 +368,53 @@
         });
     }
 
+    /**
+     * ObjectInputFilter to filter DGC input objects.
+     * The list of acceptable classes is very short and explicit.
+     * The depth and array sizes are limited.
+     *
+     * @param filterInfo access to class, arrayLength, etc.
+     * @return  {@link ObjectInputFilter.Status#ALLOWED} if allowed,
+     *          {@link ObjectInputFilter.Status#REJECTED} if rejected,
+     *          otherwise {@link ObjectInputFilter.Status#UNDECIDED}
+     */
+    private static ObjectInputFilter.Status checkInput(ObjectInputFilter.FilterInfo filterInfo) {
+        if (dgcFilter != null) {
+            ObjectInputFilter.Status status = dgcFilter.checkInput(filterInfo);
+            if (status != ObjectInputFilter.Status.UNDECIDED) {
+                // The DGC filter can override the built-in white-list
+                return status;
+            }
+        }
+
+        if (filterInfo.depth() > DGC_MAX_DEPTH) {
+            return ObjectInputFilter.Status.REJECTED;
+        }
+        Class<?> clazz = filterInfo.serialClass();
+        if (clazz != null) {
+            while (clazz.isArray()) {
+                if (filterInfo.arrayLength() >= 0 && filterInfo.arrayLength() > DGC_MAX_ARRAY_SIZE) {
+                    return ObjectInputFilter.Status.REJECTED;
+                }
+                // Arrays are allowed depending on the component type
+                clazz = clazz.getComponentType();
+            }
+            if (clazz.isPrimitive()) {
+                // Arrays of primitives are allowed
+                return ObjectInputFilter.Status.ALLOWED;
+            }
+            return (clazz == ObjID.class ||
+                    clazz == UID.class ||
+                    clazz == VMID.class ||
+                    clazz == Lease.class)
+                    ? ObjectInputFilter.Status.ALLOWED
+                    : ObjectInputFilter.Status.REJECTED;
+        }
+        // Not a class, not size limited
+        return ObjectInputFilter.Status.UNDECIDED;
+    }
+
+
     private static class LeaseInfo {
         VMID vmid;
         long expiration;
--- a/jdk/src/java.sql.rowset/share/classes/com/sun/rowset/CachedRowSetImpl.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.sql.rowset/share/classes/com/sun/rowset/CachedRowSetImpl.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,9 @@
 import java.math.*;
 import java.util.*;
 import java.text.*;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 
 import javax.sql.rowset.*;
 import javax.sql.rowset.spi.*;
@@ -357,8 +360,16 @@
         }
 
         // set the Reader, this maybe overridden latter
-        provider =
-        SyncFactory.getInstance(DEFAULT_SYNC_PROVIDER);
+        try {
+            provider = AccessController.doPrivileged(new PrivilegedExceptionAction<>() {
+                @Override
+                public SyncProvider run() throws SyncFactoryException {
+                    return SyncFactory.getInstance(DEFAULT_SYNC_PROVIDER);
+                }
+            }, null, new RuntimePermission("accessClassInPackage.com.sun.rowset.providers"));
+        } catch (PrivilegedActionException pae) {
+            throw (SyncFactoryException) pae.getException();
+        }
 
         if (!(provider instanceof RIOptimisticProvider)) {
             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidp").toString());
--- a/jdk/src/java.sql/share/classes/java/sql/Timestamp.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.sql/share/classes/java/sql/Timestamp.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -259,7 +259,7 @@
     /**
      * Formats a timestamp in JDBC timestamp escape format.
      *         {@code yyyy-mm-dd hh:mm:ss.fffffffff},
-     * where {@code ffffffffff} indicates nanoseconds.
+     * where {@code fffffffff} indicates nanoseconds.
      *
      * @return a {@code String} object in
      *           {@code yyyy-mm-dd hh:mm:ss.fffffffff} format
--- a/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java	Sat Jan 21 03:53:21 2017 +0000
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMSignatureMethod.java 1333415 2012-05-03 12:03:51Z coheigea $
@@ -41,6 +41,7 @@
 import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureECDSA;
 import com.sun.org.apache.xml.internal.security.utils.JavaUtils;
 import org.jcp.xml.dsig.internal.SignerOutputStream;
+import sun.security.util.KeyUtil;
 
 /**
  * DOM-based abstract implementation of SignatureMethod.
@@ -207,6 +208,7 @@
         if (!(key instanceof PublicKey)) {
             throw new InvalidKeyException("key must be PublicKey");
         }
+        checkKeySize(context, key);
         if (signature == null) {
             Provider p = (Provider)context.getProperty(
                     "org.jcp.xml.dsig.internal.dom.SignatureProvider");
@@ -234,6 +236,37 @@
         return signature.verify(s);
     }
 
+    /**
+     * If secure validation mode is enabled, checks that the key size is
+     * restricted.
+     *
+     * @param context the context
+     * @param key the key to check
+     * @throws XMLSignatureException if the key size is restricted
+     */
+    private static void checkKeySize(XMLCryptoContext context, Key key)
+        throws XMLSignatureException {
+        if (Utils.secureValidation(context)) {
+            int size = KeyUtil.getKeySize(key);
+            if (size == -1) {
+                // key size cannot be determined, so we cannot check against
+                // restrictions. Note that a DSA key w/o params will be
+                // rejected later if the certificate chain is validated.
+                if (log.isLoggable(java.util.logging.Level.FINE)) {
+                    log.log(java.util.logging.Level.FINE, "Size for " +
+                            key.getAlgorithm() + " key cannot be determined");
+                }
+                return;
+            }
+            if (Policy.restrictKey(key.getAlgorithm(), size)) {
+                throw new XMLSignatureException(key.getAlgorithm() +
+                    " keys less than " +
+                    Policy.minKeySize(key.getAlgorithm()) + " bits are" +
+                    " forbidden when secure validation is enabled");
+            }
+        }
+    }
+
     byte[] sign(Key key, SignedInfo si, XMLSignContext context)
         throws InvalidKeyException, XMLSignatureException
     {
@@ -244,6 +277,7 @@
         if (!(key instanceof PrivateKey)) {
             throw new InvalidKeyException("key must be PrivateKey");
         }
+        checkKeySize(context, key);
         if (signature == null) {
             Provider p = (Provider)context.getProperty(
                     "org.jcp.xml.dsig.internal.dom.SignatureProvider");
--- a/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Policy.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Policy.java	Sat Jan 21 03:53:21 2017 +0000
@@ -31,8 +31,10 @@
 import java.security.PrivilegedAction;
 import java.security.Security;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Locale;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -46,6 +48,7 @@
     private static int maxTrans = Integer.MAX_VALUE;
     private static int maxRefs = Integer.MAX_VALUE;
     private static Set<String> disallowedRefUriSchemes = new HashSet<>();
+    private static Map<String, Integer> minKeyMap = new HashMap<>();
     private static boolean noDuplicateIds = false;
     private static boolean noRMLoops = false;
 
@@ -101,6 +104,13 @@
                             scheme.toLowerCase(Locale.ROOT));
                     }
                     break;
+                case "minKeySize":
+                    if (tokens.length != 3) {
+                        error(entry);
+                    }
+                    minKeyMap.put(tokens[1],
+                                  Integer.parseUnsignedInt(tokens[2]));
+                    break;
                 case "noDuplicateIds":
                     if (tokens.length != 1) {
                         error(entry);
@@ -147,6 +157,10 @@
         return false;
     }
 
+    public static boolean restrictKey(String type, int size) {
+        return (size < minKeyMap.getOrDefault(type, 0));
+    }
+
     public static boolean restrictDuplicateIds() {
         return noDuplicateIds;
     }
@@ -171,6 +185,10 @@
         return Collections.<String>unmodifiableSet(disallowedRefUriSchemes);
     }
 
+    public static int minKeySize(String type) {
+        return minKeyMap.getOrDefault(type, 0);
+    }
+
     private static void error(String entry) {
         throw new IllegalArgumentException(
             "Invalid jdk.xml.dsig.secureValidationPolicy entry: " + entry);
--- a/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECDSASignature.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECDSASignature.java	Sat Jan 21 03:53:21 2017 +0000
@@ -455,18 +455,22 @@
     }
 
     // Convert the DER encoding of R and S into a concatenation of R and S
-    private byte[] decodeSignature(byte[] signature) throws SignatureException {
+    private byte[] decodeSignature(byte[] sig) throws SignatureException {
 
         try {
-            DerInputStream in = new DerInputStream(signature);
+            // Enforce strict DER checking for signatures
+            DerInputStream in = new DerInputStream(sig, 0, sig.length, false);
             DerValue[] values = in.getSequence(2);
+
+            // check number of components in the read sequence
+            // and trailing data
+            if ((values.length != 2) || (in.available() != 0)) {
+                throw new IOException("Invalid encoding for signature");
+            }
+
             BigInteger r = values[0].getPositiveBigInteger();
             BigInteger s = values[1].getPositiveBigInteger();
 
-            // Check for trailing signature data
-            if (in.available() != 0) {
-                throw new IOException("Incorrect signature length");
-            }
             // trim leading zeroes
             byte[] rBytes = trimZeroes(r.toByteArray());
             byte[] sBytes = trimZeroes(s.toByteArray());
@@ -480,7 +484,7 @@
             return result;
 
         } catch (Exception e) {
-            throw new SignatureException("Could not decode signature", e);
+            throw new SignatureException("Invalid encoding for signature", e);
         }
     }
 
--- a/jdk/src/jdk.crypto.ec/share/native/libsunec/impl/ec.c	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.crypto.ec/share/native/libsunec/impl/ec.c	Sat Jan 21 03:53:21 2017 +0000
@@ -34,7 +34,7 @@
  *   Dr Vipul Gupta <vipul.gupta@sun.com> and
  *   Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
  *
- * Last Modified Date from the Original Code: Nov 2016
+ * Last Modified Date from the Original Code: November 2016
  *********************************************************************** */
 
 #include "mplogic.h"
@@ -715,6 +715,16 @@
     }
 
     /*
+     * Using an equivalent exponent of fixed length (same as n or 1 bit less
+     * than n) to keep the kG timing relatively constant.
+     *
+     * Note that this is an extra step on top of the approach defined in
+     * ANSI X9.62 so as to make a fixed length K.
+     */
+    CHECK_MPI_OK( mp_add(&k, &n, &k) );
+    CHECK_MPI_OK( mp_div_2(&k, &k) );
+
+    /*
     ** ANSI X9.62, Section 5.3.2, Step 2
     **
     ** Compute kG
--- a/jdk/src/jdk.crypto.token/share/classes/sun/security/pkcs11/P11Signature.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.crypto.token/share/classes/sun/security/pkcs11/P11Signature.java	Sat Jan 21 03:53:21 2017 +0000
@@ -740,17 +740,21 @@
         }
     }
 
-    private static byte[] asn1ToDSA(byte[] signature) throws SignatureException {
+    private static byte[] asn1ToDSA(byte[] sig) throws SignatureException {
         try {
-            DerInputStream in = new DerInputStream(signature);
+            // Enforce strict DER checking for signatures
+            DerInputStream in = new DerInputStream(sig, 0, sig.length, false);
             DerValue[] values = in.getSequence(2);
+
+            // check number of components in the read sequence
+            // and trailing data
+            if ((values.length != 2) || (in.available() != 0)) {
+                throw new IOException("Invalid encoding for signature");
+            }
+
             BigInteger r = values[0].getPositiveBigInteger();
             BigInteger s = values[1].getPositiveBigInteger();
 
-            // Check for trailing signature data
-            if (in.available() != 0) {
-                throw new IOException("Incorrect signature length");
-            }
             byte[] br = toByteArray(r, 20);
             byte[] bs = toByteArray(s, 20);
             if ((br == null) || (bs == null)) {
@@ -760,21 +764,25 @@
         } catch (SignatureException e) {
             throw e;
         } catch (Exception e) {
-            throw new SignatureException("invalid encoding for signature", e);
+            throw new SignatureException("Invalid encoding for signature", e);
         }
     }
 
-    private byte[] asn1ToECDSA(byte[] signature) throws SignatureException {
+    private byte[] asn1ToECDSA(byte[] sig) throws SignatureException {
         try {
-            DerInputStream in = new DerInputStream(signature);
+            // Enforce strict DER checking for signatures
+            DerInputStream in = new DerInputStream(sig, 0, sig.length, false);
             DerValue[] values = in.getSequence(2);
+
+            // check number of components in the read sequence
+            // and trailing data
+            if ((values.length != 2) || (in.available() != 0)) {
+                throw new IOException("Invalid encoding for signature");
+            }
+
             BigInteger r = values[0].getPositiveBigInteger();
             BigInteger s = values[1].getPositiveBigInteger();
 
-            // Check for trailing signature data
-            if (in.available() != 0) {
-                throw new IOException("Incorrect signature length");
-            }
             // trim leading zeroes
             byte[] br = KeyUtil.trimZeroes(r.toByteArray());
             byte[] bs = KeyUtil.trimZeroes(s.toByteArray());
@@ -785,7 +793,7 @@
             System.arraycopy(bs, 0, res, res.length - bs.length, bs.length);
             return res;
         } catch (Exception e) {
-            throw new SignatureException("invalid encoding for signature", e);
+            throw new SignatureException("Invalid encoding for signature", e);
         }
     }
 
--- a/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java	Sat Jan 21 03:53:21 2017 +0000
@@ -26,6 +26,8 @@
 package sun.security.tools.jarsigner;
 
 import java.io.*;
+import java.security.cert.CertPathValidatorException;
+import java.security.cert.PKIXBuilderParameters;
 import java.util.*;
 import java.util.zip.*;
 import java.util.jar.*;
@@ -40,11 +42,9 @@
 import java.net.SocketTimeoutException;
 import java.net.URL;
 import java.security.cert.CertPath;
-import java.security.cert.CertPathValidator;
 import java.security.cert.CertificateExpiredException;
 import java.security.cert.CertificateFactory;
 import java.security.cert.CertificateNotYetValidException;
-import java.security.cert.PKIXParameters;
 import java.security.cert.TrustAnchor;
 import java.util.Map.Entry;
 
@@ -54,6 +54,8 @@
 import sun.security.pkcs.SignerInfo;
 import sun.security.timestamp.TimestampToken;
 import sun.security.tools.KeyStoreUtil;
+import sun.security.validator.Validator;
+import sun.security.validator.ValidatorException;
 import sun.security.x509.*;
 import sun.security.util.*;
 
@@ -177,9 +179,7 @@
 
     private boolean seeWeak = false;
 
-    CertificateFactory certificateFactory;
-    CertPathValidator validator;
-    PKIXParameters pkixParameters;
+    PKIXBuilderParameters pkixParameters;
 
     public void run(String args[]) {
         try {
@@ -1623,19 +1623,10 @@
         try {
             validateCertChain(certs);
         } catch (Exception e) {
-            if (debug) {
-                e.printStackTrace();
-            }
-            if (e.getCause() != null &&
-                    (e.getCause() instanceof CertificateExpiredException ||
-                     e.getCause() instanceof CertificateNotYetValidException)) {
-                // No more warning, we alreay have hasExpiredCert or notYetValidCert
-            } else {
-                chainNotValidated = true;
-                chainNotValidatedReason = e;
-                sb.append(tab).append(rb.getString(".CertPath.not.validated."))
-                        .append(e.getLocalizedMessage()).append("]\n"); // TODO
-            }
+            chainNotValidated = true;
+            chainNotValidatedReason = e;
+            sb.append(tab).append(rb.getString(".CertPath.not.validated."))
+                    .append(e.getLocalizedMessage()).append("]\n"); // TODO
         }
         if (certs.size() == 1
                 && KeyStoreUtil.isSelfSigned((X509Certificate)certs.get(0))) {
@@ -1654,9 +1645,6 @@
         }
 
         try {
-
-            certificateFactory = CertificateFactory.getInstance("X.509");
-            validator = CertPathValidator.getInstance("PKIX");
             Set<TrustAnchor> tas = new HashSet<>();
             try {
                 KeyStore caks = KeyStoreUtil.getCacertsKeyStore();
@@ -1732,7 +1720,7 @@
                 }
             } finally {
                 try {
-                    pkixParameters = new PKIXParameters(tas);
+                    pkixParameters = new PKIXBuilderParameters(tas, null);
                     pkixParameters.setRevocationEnabled(false);
                 } catch (InvalidAlgorithmParameterException ex) {
                     // Only if tas is empty
@@ -1899,17 +1887,8 @@
             try {
                 validateCertChain(Arrays.asList(certChain));
             } catch (Exception e) {
-                if (debug) {
-                    e.printStackTrace();
-                }
-                if (e.getCause() != null &&
-                        (e.getCause() instanceof CertificateExpiredException ||
-                        e.getCause() instanceof CertificateNotYetValidException)) {
-                    // No more warning, we already have hasExpiredCert or notYetValidCert
-                } else {
-                    chainNotValidated = true;
-                    chainNotValidatedReason = e;
-                }
+                chainNotValidated = true;
+                chainNotValidatedReason = e;
             }
 
             if (KeyStoreUtil.isSelfSigned(certChain[0])) {
@@ -1966,18 +1945,40 @@
     }
 
     void validateCertChain(List<? extends Certificate> certs) throws Exception {
-        int cpLen = 0;
-        out: for (; cpLen<certs.size(); cpLen++) {
-            for (TrustAnchor ta: pkixParameters.getTrustAnchors()) {
-                if (ta.getTrustedCert().equals(certs.get(cpLen))) {
-                    break out;
+        try {
+            Validator.getInstance(Validator.TYPE_PKIX,
+                    Validator.VAR_CODE_SIGNING,
+                    pkixParameters)
+                    .validate(certs.toArray(new X509Certificate[certs.size()]));
+        } catch (Exception e) {
+            if (debug) {
+                e.printStackTrace();
+            }
+            if (e instanceof ValidatorException) {
+                // Throw cause if it's CertPathValidatorException,
+                if (e.getCause() != null &&
+                        e.getCause() instanceof CertPathValidatorException) {
+                    e = (Exception) e.getCause();
+                    Throwable t = e.getCause();
+                    if ((t instanceof CertificateExpiredException &&
+                                hasExpiredCert) ||
+                            (t instanceof CertificateNotYetValidException &&
+                                    notYetValidCert)) {
+                        // we already have hasExpiredCert and notYetValidCert
+                        return;
+                    }
+                }
+                if (e instanceof ValidatorException) {
+                    ValidatorException ve = (ValidatorException)e;
+                    if (ve.getErrorType() == ValidatorException.T_EE_EXTENSIONS &&
+                            (badKeyUsage || badExtendedKeyUsage || badNetscapeCertType)) {
+                        // We already have badKeyUsage, badExtendedKeyUsage
+                        // and badNetscapeCertType
+                        return;
+                    }
                 }
             }
-        }
-        if (cpLen > 0) {
-            CertPath cp = certificateFactory.generateCertPath(
-                    (cpLen == certs.size())? certs: certs.subList(0, cpLen));
-            validator.validate(cp, pkixParameters);
+            throw e;
         }
     }
 
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java	Sat Jan 21 03:53:21 2017 +0000
@@ -162,22 +162,13 @@
             });
 
             if (this.targetOsName == null) {
-                throw new PluginException("TargetPlatform attribute is missing for java.base module");
+                throw new PluginException("ModuleTarget attribute is missing for java.base module");
             }
 
+            checkResourcePool(files);
+
             Path bin = root.resolve(BIN_DIRNAME);
 
-            // check any duplicated resource files
-            Map<Path, Set<String>> duplicates = new HashMap<>();
-            files.entries()
-                .filter(f -> f.type() != ResourcePoolEntry.Type.CLASS_OR_RESOURCE)
-                .collect(groupingBy(this::entryToImagePath,
-                         mapping(ResourcePoolEntry::moduleName, toSet())))
-                .entrySet()
-                .stream()
-                .filter(e -> e.getValue().size() > 1)
-                .forEach(e -> duplicates.put(e.getKey(), e.getValue()));
-
             // write non-classes resource files to the image
             files.entries()
                 .filter(f -> f.type() != ResourcePoolEntry.Type.CLASS_OR_RESOURCE)
@@ -185,13 +176,8 @@
                     try {
                         accept(f);
                     } catch (FileAlreadyExistsException e) {
-                        // error for duplicated entries
-                        Path path = entryToImagePath(f);
-                        UncheckedIOException x =
-                            new UncheckedIOException(path + " duplicated in " +
-                                    duplicates.get(path), e);
-                        x.addSuppressed(e);
-                        throw x;
+                        // Should not happen! Duplicates checking already done!
+                        throw new AssertionError("Duplicate entry!", e);
                     } catch (IOException ioExp) {
                         throw new UncheckedIOException(ioExp);
                     }
@@ -242,6 +228,27 @@
         }
     }
 
+    private void checkResourcePool(ResourcePool pool) {
+        // For now, only duplicate resources check. Add more checks here (if any)
+        checkDuplicateResources(pool);
+    }
+
+    private void checkDuplicateResources(ResourcePool pool) {
+        // check any duplicated resources
+        Map<Path, Set<String>> duplicates = new HashMap<>();
+        pool.entries()
+             .filter(f -> f.type() != ResourcePoolEntry.Type.CLASS_OR_RESOURCE)
+             .collect(groupingBy(this::entryToImagePath,
+                      mapping(ResourcePoolEntry::moduleName, toSet())))
+             .entrySet()
+             .stream()
+             .filter(e -> e.getValue().size() > 1)
+             .forEach(e -> duplicates.put(e.getKey(), e.getValue()));
+        if (!duplicates.isEmpty()) {
+            throw new PluginException("Duplicate resources: " + duplicates);
+        }
+    }
+
     /**
      * Generates launcher scripts.
      *
--- a/jdk/src/jdk.jlink/share/classes/module-info.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.jlink/share/classes/module-info.java	Sat Jan 21 03:53:21 2017 +0000
@@ -24,8 +24,6 @@
  */
 
 module jdk.jlink {
-    exports jdk.tools.jlink.plugin;
-
     requires jdk.internal.opt;
     requires jdk.jdeps;
 
--- a/jdk/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java	Sat Jan 21 03:53:21 2017 +0000
@@ -32,6 +32,8 @@
 import java.rmi.server.*;
 import java.rmi.registry.Registry;
 import java.rmi.registry.LocateRegistry;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 import javax.naming.*;
 import javax.naming.spi.NamingManager;
@@ -52,6 +54,18 @@
     private int port;
     private static final NameParser nameParser = new AtomicNameParser();
     private static final String SOCKET_FACTORY = "com.sun.jndi.rmi.factory.socket";
+    /**
+     * Determines whether classes may be loaded from an arbitrary URL code base.
+     */
+    static final boolean trustURLCodebase;
+    static {
+        // System property to control whether classes may be loaded from an
+        // arbitrary URL codebase
+        PrivilegedAction<String> act = () -> System.getProperty(
+            "com.sun.jndi.rmi.object.trustURLCodebase", "false");
+        String trust = AccessController.doPrivileged(act);
+        trustURLCodebase = "true".equalsIgnoreCase(trust);
+    }
 
     Reference reference = null; // ref used to create this context, if any
 
@@ -460,6 +474,27 @@
             Object obj = (r instanceof RemoteReference)
                         ? ((RemoteReference)r).getReference()
                         : (Object)r;
+
+            /*
+             * Classes may only be loaded from an arbitrary URL codebase when
+             * the system property com.sun.jndi.rmi.object.trustURLCodebase
+             * has been set to "true".
+             */
+
+            // Use reference if possible
+            Reference ref = null;
+            if (obj instanceof Reference) {
+                ref = (Reference) obj;
+            } else if (obj instanceof Referenceable) {
+                ref = ((Referenceable)(obj)).getReference();
+            }
+
+            if (ref != null && ref.getFactoryClassLocation() != null &&
+                !trustURLCodebase) {
+                throw new ConfigurationException(
+                    "The object factory is untrusted. Set the system property" +
+                    " 'com.sun.jndi.rmi.object.trustURLCodebase' to 'true'.");
+            }
             return NamingManager.getObjectInstance(obj, name, this,
                                                    environment);
         } catch (NamingException e) {
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java	Sat Jan 21 03:53:21 2017 +0000
@@ -418,7 +418,6 @@
             constraints = new SearchControls();
             constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
             constraints.setReturningAttributes(new String[0]); //return no attrs
-            constraints.setReturningObjFlag(true); // to get the full DN
         }
 
         authzIdentity = (String)options.get(AUTHZ_IDENTITY);
@@ -878,11 +877,7 @@
             // (Use the first entry if more than one is returned)
             if (results.hasMore()) {
                 SearchResult entry = results.next();
-
-                // %%% - use the SearchResult.getNameInNamespace method
-                //        available in JDK 1.5 and later.
-                //        (can remove call to constraints.setReturningObjFlag)
-                userDN = ((Context)entry.getObject()).getNameInNamespace();
+                userDN = entry.getNameInNamespace();
 
                 if (debug) {
                     System.out.println("\t\t[LdapLoginModule] found entry: " +
--- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java	Sat Jan 21 03:53:21 2017 +0000
@@ -135,7 +135,7 @@
         TreeMap<Integer,IndexNode> map = new TreeMap<>();
         IndexNode child = metaInfVersions.child;
         while (child != null) {
-            Integer key = getVersion(child.name, metaInfVersions.name.length);
+            Integer key = getVersion(child.name, metaInfVersions.name.length + 1);
             if (key != null && key <= version) {
                 map.put(key, child);
             }
@@ -149,7 +149,7 @@
      */
     private Integer getVersion(byte[] name, int offset) {
         try {
-            return Integer.parseInt(getString(Arrays.copyOfRange(name, offset, name.length-1)));
+            return Integer.parseInt(getString(Arrays.copyOfRange(name, offset, name.length)));
         } catch (NumberFormatException x) {
             // ignore this even though it might indicate issues with the JAR structure
             return null;
@@ -176,7 +176,7 @@
      *   returns foo/bar.class
      */
     private byte[] getRootName(IndexNode prefix, IndexNode inode) {
-        int offset = prefix.name.length - 1;
+        int offset = prefix.name.length;
         byte[] fullName = inode.name;
         return Arrays.copyOfRange(fullName, offset, fullName.length);
     }
--- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipCoder.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipCoder.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,21 +34,56 @@
 import java.nio.charset.CodingErrorAction;
 import java.util.Arrays;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.nio.charset.StandardCharsets.ISO_8859_1;
+
 /**
  * Utility class for zipfile name and comment decoding and encoding
  *
  * @author  Xueming Shen
  */
 
-final class ZipCoder {
+class ZipCoder {
+
+    static class UTF8 extends ZipCoder {
+        UTF8() {
+            super(UTF_8);
+        }
+
+        @Override
+        byte[] getBytes(String s) {        // fast pass for ascii
+            for (int i = 0; i < s.length(); i++) {
+                if (s.charAt(i) > 0x7f) return super.getBytes(s);
+            }
+            return s.getBytes(ISO_8859_1);
+        }
 
-    String toString(byte[] ba, int length) {
+        @Override
+        String toString(byte[] ba) {
+            for (byte b : ba) {
+                if (b < 0) return super.toString(ba);
+            }
+            return new String(ba, ISO_8859_1);
+        }
+    }
+
+    private static final ZipCoder utf8 = new UTF8();
+
+    public static ZipCoder get(String csn) {
+        Charset cs = Charset.forName(csn);
+        if (cs.name().equals("UTF-8")) {
+            return utf8;
+        }
+        return new ZipCoder(cs);
+    }
+
+    String toString(byte[] ba) {
         CharsetDecoder cd = decoder().reset();
-        int len = (int)(length * cd.maxCharsPerByte());
-        char[] ca = new char[len];
-        if (len == 0)
+        int clen = (int)(ba.length * cd.maxCharsPerByte());
+        char[] ca = new char[clen];
+        if (clen == 0)
             return new String(ca);
-        ByteBuffer bb = ByteBuffer.wrap(ba, 0, length);
+        ByteBuffer bb = ByteBuffer.wrap(ba, 0, ba.length);
         CharBuffer cb = CharBuffer.wrap(ca);
         CoderResult cr = cd.decode(bb, cb, true);
         if (!cr.isUnderflow())
@@ -59,10 +94,6 @@
         return new String(ca, 0, cb.position());
     }
 
-    String toString(byte[] ba) {
-        return toString(ba, ba.length);
-    }
-
     byte[] getBytes(String s) {
         CharsetEncoder ce = encoder().reset();
         char[] ca = s.toCharArray();
@@ -84,47 +115,14 @@
             return Arrays.copyOf(ba, bb.position());
     }
 
-    // assume invoked only if "this" is not utf8
-    byte[] getBytesUTF8(String s) {
-        if (isutf8)
-            return getBytes(s);
-        if (utf8 == null)
-            utf8 = new ZipCoder(Charset.forName("UTF-8"));
-        return utf8.getBytes(s);
-    }
-
-    String toStringUTF8(byte[] ba, int len) {
-        if (isutf8)
-            return toString(ba, len);
-        if (utf8 == null)
-            utf8 = new ZipCoder(Charset.forName("UTF-8"));
-        return utf8.toString(ba, len);
-    }
-
     boolean isUTF8() {
-        return isutf8;
+        return cs == UTF_8;
     }
 
     private Charset cs;
-    private boolean isutf8;
-    private ZipCoder utf8;
 
     private ZipCoder(Charset cs) {
         this.cs = cs;
-        this.isutf8 = cs.name().equals("UTF-8");
-    }
-
-    static ZipCoder get(Charset charset) {
-        return new ZipCoder(charset);
-    }
-
-    static ZipCoder get(String csn) {
-        try {
-            return new ZipCoder(Charset.forName(csn));
-        } catch (Throwable t) {
-            t.printStackTrace();
-        }
-        return new ZipCoder(Charset.defaultCharset());
     }
 
     private final ThreadLocal<CharsetDecoder> decTL = new ThreadLocal<>();
@@ -133,10 +131,10 @@
     private CharsetDecoder decoder() {
         CharsetDecoder dec = decTL.get();
         if (dec == null) {
-            dec = cs.newDecoder()
-              .onMalformedInput(CodingErrorAction.REPORT)
-              .onUnmappableCharacter(CodingErrorAction.REPORT);
-            decTL.set(dec);
+        dec = cs.newDecoder()
+            .onMalformedInput(CodingErrorAction.REPORT)
+            .onUnmappableCharacter(CodingErrorAction.REPORT);
+        decTL.set(dec);
         }
         return dec;
     }
@@ -144,10 +142,10 @@
     private CharsetEncoder encoder() {
         CharsetEncoder enc = encTL.get();
         if (enc == null) {
-            enc = cs.newEncoder()
-              .onMalformedInput(CodingErrorAction.REPORT)
-              .onUnmappableCharacter(CodingErrorAction.REPORT);
-            encTL.set(enc);
+        enc = cs.newEncoder()
+            .onMalformedInput(CodingErrorAction.REPORT)
+            .onUnmappableCharacter(CodingErrorAction.REPORT);
+        encTL.set(enc);
         }
         return enc;
     }
--- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -314,8 +314,8 @@
                 IndexNode inode = getInode(path);
                 if (inode == null)
                     return null;
-                e = new Entry(inode.name);       // pseudo directory
-                e.method = METHOD_STORED;        // STORED for dir
+                e = new Entry(inode.name, inode.isdir);  // pseudo directory
+                e.method = METHOD_STORED;         // STORED for dir
                 e.mtime = e.atime = e.ctime = zfsDefaultTimeStamp;
             }
         } finally {
@@ -400,7 +400,8 @@
             List<Path> list = new ArrayList<>();
             IndexNode child = inode.child;
             while (child != null) {
-                ZipPath zp = new ZipPath(this, child.name);
+                // assume all path from zip file itself is "normalized"
+                ZipPath zp = new ZipPath(this, child.name, true);
                 if (filter == null || filter.accept(zp))
                     list.add(zp);
                 child = child.sibling;
@@ -415,14 +416,14 @@
         throws IOException
     {
         checkWritable();
-        dir = toDirectoryPath(dir);
+        //  dir = toDirectoryPath(dir);
         beginWrite();
         try {
             ensureOpen();
             if (dir.length == 0 || exists(dir))  // root dir, or exiting dir
                 throw new FileAlreadyExistsException(getString(dir));
             checkParents(dir);
-            Entry e = new Entry(dir, Entry.NEW);
+            Entry e = new Entry(dir, Entry.NEW, true);
             e.method = METHOD_STORED;            // STORED for dir
             update(e);
         } finally {
@@ -463,7 +464,7 @@
             } else {
                 checkParents(dst);
             }
-            Entry u = new Entry(eSrc, Entry.COPY);    // copy eSrc entry
+            Entry u = new Entry(eSrc, Entry.COPY);  // copy eSrc entry
             u.name(dst);                              // change name
             if (eSrc.type == Entry.NEW || eSrc.type == Entry.FILECH)
             {
@@ -533,7 +534,7 @@
                 if (!hasCreate && !hasCreateNew)
                     throw new NoSuchFileException(getString(path));
                 checkParents(path);
-                return getOutputStream(new Entry(path, Entry.NEW));
+                return getOutputStream(new Entry(path, Entry.NEW, false));
             }
         } finally {
             endRead();
@@ -887,7 +888,7 @@
         int off = getParentOff(path);
         if (off <= 1)
             return ROOTPATH;
-        return Arrays.copyOf(path, off + 1);
+        return Arrays.copyOf(path, off);
     }
 
     private static int getParentOff(byte[] path) {
@@ -1075,11 +1076,9 @@
             if (pos + CENHDR + nlen > limit) {
                 zerror("invalid CEN header (bad header size)");
             }
-            byte[] name = new byte[nlen + 1];
-            System.arraycopy(cen, pos + CENHDR, name, 1, nlen);
-            name[0] = '/';
-            IndexNode inode = new IndexNode(name, pos);
+            IndexNode inode = new IndexNode(cen, pos + CENHDR, nlen, pos);
             inodes.put(inode, inode);
+
             // skip ext and comment
             pos += (CENHDR + nlen + elen + clen);
         }
@@ -1112,7 +1111,7 @@
     private boolean hasUpdate = false;
 
     // shared key. consumer guarantees the "writeLock" before use it.
-    private final IndexNode LOOKUPKEY = IndexNode.keyOf(null);
+    private final IndexNode LOOKUPKEY = new IndexNode(null, -1);
 
     private void updateDelete(IndexNode inode) {
         beginWrite();
@@ -1312,16 +1311,7 @@
     IndexNode getInode(byte[] path) {
         if (path == null)
             throw new NullPointerException("path");
-        IndexNode key = IndexNode.keyOf(path);
-        IndexNode inode = inodes.get(key);
-        if (inode == null &&
-            (path.length == 0 || path[path.length -1] != '/')) {
-            // if does not ends with a slash
-            path = Arrays.copyOf(path, path.length + 1);
-            path[path.length - 1] = '/';
-            inode = inodes.get(key.as(path));
-        }
-        return inode;
+        return inodes.get(IndexNode.keyOf(path));
     }
 
     Entry getEntry(byte[] path) throws IOException {
@@ -1782,8 +1772,11 @@
         int    hashcode;  // node is hashable/hashed by its name
         int    pos = -1;  // position in cen table, -1 menas the
                           // entry does not exists in zip file
-        IndexNode(byte[] name) {
+        boolean isdir;
+
+        IndexNode(byte[] name, boolean isdir) {
             name(name);
+            this.isdir = isdir;
             this.pos = -1;
         }
 
@@ -1792,8 +1785,28 @@
             this.pos = pos;
         }
 
+        // constructor for cenInit()
+        IndexNode(byte[] cen, int noff, int nlen, int pos) {
+            if (cen[noff + nlen - 1] == '/') {
+                isdir = true;
+                nlen--;
+            }
+            name = new byte[nlen + 1];
+            System.arraycopy(cen, pos + CENHDR, name, 1, nlen);
+            name[0] = '/';
+            name(name);
+            this.pos = pos;
+        }
+
+        private static final ThreadLocal<IndexNode> cachedKey = new ThreadLocal<>();
+
         final static IndexNode keyOf(byte[] name) { // get a lookup key;
-            return new IndexNode(name, -1);
+            IndexNode key = cachedKey.get();
+            if (key == null) {
+                key = new IndexNode(name, -1);
+                cachedKey.set(key);
+            }
+            return key.as(name);
         }
 
         final void name(byte[] name) {
@@ -1807,8 +1820,7 @@
         }
 
         boolean isDir() {
-            return name != null &&
-                   (name.length == 0 || name[name.length - 1] == '/');
+            return isdir;
         }
 
         public boolean equals(Object other) {
@@ -1865,8 +1877,9 @@
 
         Entry() {}
 
-        Entry(byte[] name) {
+        Entry(byte[] name, boolean isdir) {
             name(name);
+            this.isdir = isdir;
             this.mtime  = this.ctime = this.atime = System.currentTimeMillis();
             this.crc    = 0;
             this.size   = 0;
@@ -1874,13 +1887,14 @@
             this.method = METHOD_DEFLATED;
         }
 
-        Entry(byte[] name, int type) {
-            this(name);
+        Entry(byte[] name, int type, boolean isdir) {
+            this(name, isdir);
             this.type = type;
         }
 
         Entry (Entry e, int type) {
             name(e.name);
+            this.isdir     = e.isdir;
             this.version   = e.version;
             this.ctime     = e.ctime;
             this.atime     = e.atime;
@@ -1902,7 +1916,7 @@
         }
 
         Entry (byte[] name, Path file, int type) {
-            this(name, type);
+            this(name, type, false);
             this.file = file;
             this.method = METHOD_STORED;
         }
@@ -1948,6 +1962,7 @@
             locoff      = CENOFF(cen, pos);
             pos += CENHDR;
             this.name = inode.name;
+            this.isdir = inode.isdir;
             this.hashcode = inode.hashcode;
 
             pos += nlen;
@@ -1974,9 +1989,10 @@
             int elenEXTT = 0;                // extra for Extended Timestamp
             boolean foundExtraTime = false;  // if time stamp NTFS, EXTT present
 
-            // confirm size/length
+            byte[] zname = isdir ? toDirectoryPath(name) : name;
 
-            int nlen = (name != null) ? name.length - 1 : 0;  // name has [0] as "slash"
+            // confirm size/length
+            int nlen = (zname != null) ? zname.length - 1 : 0;  // name has [0] as "slash"
             int elen = (extra != null) ? extra.length : 0;
             int eoff = 0;
             int clen = (comment != null) ? comment.length : 0;
@@ -2037,7 +2053,7 @@
             writeShort(os, 0);              // internal file attributes (unused)
             writeInt(os, 0);                // external file attributes (unused)
             writeInt(os, locoff0);          // relative offset of local header
-            writeBytes(os, name, 1, nlen);
+            writeBytes(os, zname, 1, nlen);
             if (elen64 != 0) {
                 writeShort(os, EXTID_ZIP64);// Zip64 extra
                 writeShort(os, elen64 - 4); // size of "this" extra block
@@ -2075,87 +2091,13 @@
         }
 
         ///////////////////// LOC //////////////////////
-        static Entry readLOC(ZipFileSystem zipfs, long pos)
-            throws IOException
-        {
-            return readLOC(zipfs, pos, new byte[1024]);
-        }
-
-        static Entry readLOC(ZipFileSystem zipfs, long pos, byte[] buf)
-            throws IOException
-        {
-            return new Entry().loc(zipfs, pos, buf);
-        }
-
-        Entry loc(ZipFileSystem zipfs, long pos, byte[] buf)
-            throws IOException
-        {
-            assert (buf.length >= LOCHDR);
-            if (zipfs.readFullyAt(buf, 0, LOCHDR , pos) != LOCHDR)
-                throw new ZipException("loc: reading failed");
-            if (!locSigAt(buf, 0))
-                throw new ZipException("loc: wrong sig ->"
-                                       + Long.toString(getSig(buf, 0), 16));
-            //startPos = pos;
-            version  = LOCVER(buf);
-            flag     = LOCFLG(buf);
-            method   = LOCHOW(buf);
-            mtime    = dosToJavaTime(LOCTIM(buf));
-            crc      = LOCCRC(buf);
-            csize    = LOCSIZ(buf);
-            size     = LOCLEN(buf);
-            int nlen = LOCNAM(buf);
-            int elen = LOCEXT(buf);
-
-            name = new byte[nlen + 1];
-            name[0] = '/';
-            if (zipfs.readFullyAt(name, 1, nlen, pos + LOCHDR) != nlen) {
-                throw new ZipException("loc: name reading failed");
-            }
-            if (elen > 0) {
-                extra = new byte[elen];
-                if (zipfs.readFullyAt(extra, 0, elen, pos + LOCHDR + nlen)
-                    != elen) {
-                    throw new ZipException("loc: ext reading failed");
-                }
-            }
-            pos += (LOCHDR + nlen + elen);
-            if ((flag & FLAG_DATADESCR) != 0) {
-                // Data Descriptor
-                Entry e = zipfs.getEntry(name);  // get the size/csize from cen
-                if (e == null)
-                    throw new ZipException("loc: name not found in cen");
-                size = e.size;
-                csize = e.csize;
-                pos += (method == METHOD_STORED ? size : csize);
-                if (size >= ZIP64_MINVAL || csize >= ZIP64_MINVAL)
-                    pos += 24;
-                else
-                    pos += 16;
-            } else {
-                if (extra != null &&
-                    (size == ZIP64_MINVAL || csize == ZIP64_MINVAL)) {
-                    // zip64 ext: must include both size and csize
-                    int off = 0;
-                    while (off + 20 < elen) {    // HeaderID+DataSize+Data
-                        int sz = SH(extra, off + 2);
-                        if (SH(extra, off) == EXTID_ZIP64 && sz == 16) {
-                            size = LL(extra, off + 4);
-                            csize = LL(extra, off + 12);
-                            break;
-                        }
-                        off += (sz + 4);
-                    }
-                }
-                pos += (method == METHOD_STORED ? size : csize);
-            }
-            return this;
-        }
 
         int writeLOC(OutputStream os) throws IOException {
             writeInt(os, LOCSIG);               // LOC header signature
             int version = version();
-            int nlen = (name != null) ? name.length - 1 : 0; // [0] is slash
+
+            byte[] zname = isdir ? toDirectoryPath(name) : name;
+            int nlen = (zname != null) ? zname.length - 1 : 0; // [0] is slash
             int elen = (extra != null) ? extra.length : 0;
             boolean foundExtraTime = false;     // if extra timestamp present
             int eoff = 0;
@@ -2214,7 +2156,7 @@
             }
             writeShort(os, nlen);
             writeShort(os, elen + elen64 + elenNTFS + elenEXTT);
-            writeBytes(os, name, 1, nlen);
+            writeBytes(os, zname, 1, nlen);
             if (elen64 != 0) {
                 writeShort(os, EXTID_ZIP64);
                 writeShort(os, 16);
@@ -2352,16 +2294,17 @@
                             locPos += locSZ;
                              continue;
                         }
+                        int end = locPos + locSZ - 4;
                         int flag = CH(buf, locPos++);
-                        if ((flag & 0x1) != 0) {
+                        if ((flag & 0x1) != 0 && locPos <= end) {
                             mtime = unixToJavaTime(LG(buf, locPos));
                             locPos += 4;
                         }
-                        if ((flag & 0x2) != 0) {
+                        if ((flag & 0x2) != 0 && locPos <= end) {
                             atime = unixToJavaTime(LG(buf, locPos));
                             locPos += 4;
                         }
-                        if ((flag & 0x4) != 0) {
+                        if ((flag & 0x4) != 0 && locPos <= end) {
                             ctime = unixToJavaTime(LG(buf, locPos));
                             locPos += 4;
                         }
@@ -2551,7 +2494,7 @@
     private void buildNodeTree() throws IOException {
         beginWrite();
         try {
-            IndexNode root = new IndexNode(ROOTPATH);
+            IndexNode root = new IndexNode(ROOTPATH, true);
             IndexNode[] nodes = inodes.keySet().toArray(new IndexNode[0]);
             inodes.put(root, root);
             ParentLookup lookup = new ParentLookup();
@@ -2564,7 +2507,7 @@
                         root.child = node;
                         break;
                     }
-                    lookup = lookup.as(node.name, off + 1);
+                    lookup = lookup.as(node.name, off);
                     if (inodes.containsKey(lookup)) {
                         parent = inodes.get(lookup);
                         node.sibling = parent.child;
@@ -2572,7 +2515,7 @@
                         break;
                     }
                     // add new pseudo directory entry
-                    parent = new IndexNode(Arrays.copyOf(node.name, off + 1));
+                    parent = new IndexNode(Arrays.copyOf(node.name, off), true);
                     inodes.put(parent, parent);
                     node.sibling = parent.child;
                     parent.child = node;
--- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,8 +59,7 @@
         } else {
             if (zfs.zc.isUTF8()) {
                 this.path = normalize(path);
-            } else {
-                // see normalize(String);
+            } else {    // see normalize(String);
                 this.path = normalize(zfs.getString(path));
             }
         }
@@ -68,12 +67,7 @@
 
     ZipPath(ZipFileSystem zfs, String path) {
         this.zfs = zfs;
-        if (zfs.zc.isUTF8()) {
-            this.path = normalize(zfs.getBytes(path));
-        } else {
-            // see normalize(String);
-            this.path = normalize(path);
-        }
+        this.path = normalize(path);
     }
 
     @Override
@@ -84,33 +78,31 @@
             return null;
     }
 
-    @Override
+   @Override
     public Path getFileName() {
-        initOffsets();
-        int count = offsets.length;
-        if (count == 0)
-            return null;  // no elements so no name
-        if (count == 1 && path[0] != '/')
+        int off = path.length;
+        if (off == 0 || off == 1 && path[0] == '/')
+            return null;
+        while (--off >= 0 && path[off] != '/') {}
+        if (off < 0)
             return this;
-        int lastOffset = offsets[count-1];
-        int len = path.length - lastOffset;
-        byte[] result = new byte[len];
-        System.arraycopy(path, lastOffset, result, 0, len);
-        return new ZipPath(zfs, result);
+        off++;
+        byte[] result = new byte[path.length - off];
+        System.arraycopy(path, off, result, 0, result.length);
+        return new ZipPath(getFileSystem(), result, true);
     }
 
     @Override
     public ZipPath getParent() {
-        initOffsets();
-        int count = offsets.length;
-        if (count == 0)    // no elements so no parent
+        int off = path.length;
+        if (off == 0 || off == 1 && path[0] == '/')
             return null;
-        int len = offsets[count-1] - 1;
-        if (len <= 0)      // parent is root only (may be null)
+        while (--off >= 0 && path[off] != '/') {}
+        if (off <= 0)
             return getRoot();
-        byte[] result = new byte[len];
-        System.arraycopy(path, 0, result, 0, len);
-        return new ZipPath(zfs, result);
+        byte[] result = new byte[off];
+        System.arraycopy(path, 0, result, 0, off);
+        return new ZipPath(getFileSystem(), result, true);
     }
 
     @Override
@@ -277,30 +269,36 @@
 
     @Override
     public boolean isAbsolute() {
-        return (this.path.length > 0 && path[0] == '/');
+        return path.length > 0 && path[0] == '/';
     }
 
     @Override
     public ZipPath resolve(Path other) {
-        final ZipPath o = checkPath(other);
-        int tlen = this.path.length;
-        if (tlen == 0 || o.isAbsolute())
+        ZipPath o = checkPath(other);
+        if (o.path.length == 0)
+            return this;
+        if (o.isAbsolute() || this.path.length == 0)
             return o;
-        int olen = o.path.length;
-        if (olen == 0)
-            return this;
+        return resolve(o.path);
+    }
+
+    // opath is normalized, just concat
+    private ZipPath resolve(byte[] opath) {
         byte[] resolved = null;
-        if (this.path[tlen - 1] == '/') {
+        byte[] tpath = this.path;
+        int tlen = tpath.length;
+        int olen = opath.length;
+        if (path[tlen - 1] == '/') {
             resolved = new byte[tlen + olen];
-            System.arraycopy(path, 0, resolved, 0, tlen);
-            System.arraycopy(o.path, 0, resolved, tlen, olen);
+            System.arraycopy(tpath, 0, resolved, 0, tlen);
+            System.arraycopy(opath, 0, resolved, tlen, olen);
         } else {
             resolved = new byte[tlen + 1 + olen];
-            System.arraycopy(path, 0, resolved, 0, tlen);
+            System.arraycopy(tpath, 0, resolved, 0, tlen);
             resolved[tlen] = '/';
-            System.arraycopy(o.path, 0, resolved, tlen + 1, olen);
+            System.arraycopy(opath, 0, resolved, tlen + 1, olen);
         }
-        return new ZipPath(zfs, resolved);
+        return new ZipPath(zfs, resolved, true);
     }
 
     @Override
@@ -351,7 +349,12 @@
 
     @Override
     public ZipPath resolve(String other) {
-        return resolve(zfs.getPath(other));
+        byte[] opath = normalize(other);
+        if (opath.length == 0)
+            return this;
+        if (opath[0] == '/' || this.path.length == 0)
+            return new ZipPath(zfs, opath, true);
+        return resolve(opath);
     }
 
     @Override
@@ -455,8 +458,9 @@
                 return normalize(path, i - 1);
             prevC = c;
         }
-        if (len > 1 && prevC == '/')
+        if (len > 1 && prevC == '/') {
             return Arrays.copyOf(path, len - 1);
+        }
         return path;
     }
 
@@ -490,6 +494,8 @@
     // to avoid incorrectly normalizing byte '0x5c' (as '\')
     // to '/'.
     private byte[] normalize(String path) {
+        if (zfs.zc.isUTF8())
+            return normalize(zfs.getBytes(path));
         int len = path.length();
         if (len == 0)
             return new byte[0];
@@ -533,7 +539,8 @@
     // Remove DotSlash(./) and resolve DotDot (..) components
     private byte[] getResolved() {
         for (int i = 0; i < path.length; i++) {
-            if (path[i] == (byte)'.') {
+            if (path[i] == (byte)'.' &&
+                (i + 1 == path.length || path[i + 1] == '/')) {
                 return resolve0();
             }
         }
@@ -976,5 +983,4 @@
         }
         return sb.toString();
     }
-
 }
--- a/jdk/test/ProblemList.txt	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/ProblemList.txt	Sat Jan 21 03:53:21 2017 +0000
@@ -118,6 +118,35 @@
 
 java/beans/Introspector/8132566/OverridePropertyInfoTest.java   8132565 generic-all
 java/beans/Introspector/8132566/OverrideUserDefPropertyInfoTest.java 8132565 generic-all
+java/beans/PropertyEditor/TestBooleanClass.java                 8173082 generic-all
+java/beans/PropertyEditor/TestByteClass.java                    8173082 generic-all
+java/beans/PropertyEditor/TestColorClass.java                   8173082 generic-all
+java/beans/PropertyEditor/TestDoubleClass.java                  8173082 generic-all
+java/beans/PropertyEditor/TestFloatClass.java                   8173082 generic-all
+java/beans/PropertyEditor/TestFontClass.java                    8173082 generic-all
+java/beans/PropertyEditor/TestIntegerClass.java                 8173082 generic-all
+java/beans/PropertyEditor/TestLongClass.java                    8173082 generic-all
+java/beans/PropertyEditor/TestShortClass.java                   8173082 generic-all
+java/beans/PropertyEditor/TestStringClass.java                  8173082 generic-all
+java/beans/XMLEncoder/Test6570354.java                          8173082 generic-all
+java/beans/XMLDecoder/spec/TestObject.java                      8173082 macosx-all
+java/beans/XMLEncoder/Test4631471.java                          8173082 macosx-all
+java/beans/XMLEncoder/Test4652928.java                          8173082 macosx-all
+java/beans/XMLEncoder/Test4903007.java                          8173082 macosx-all
+java/beans/XMLEncoder/Test6437265.java                          8173082 macosx-all
+java/beans/XMLEncoder/Test6501431.java                          8173082 macosx-all
+java/beans/XMLEncoder/java_awt_BorderLayout.java                8173082 macosx-all
+java/beans/XMLEncoder/java_awt_CardLayout.java                  8173082 macosx-all
+java/beans/XMLEncoder/java_awt_GridBagLayout.java               8173082 macosx-all
+java/beans/XMLEncoder/javax_swing_BoxLayout.java                8173082 macosx-all
+java/beans/XMLEncoder/javax_swing_DefaultCellEditor.java        8173082 macosx-all
+java/beans/XMLEncoder/javax_swing_JButton.java                  8173082 macosx-all
+java/beans/XMLEncoder/javax_swing_JLayeredPane.java             8173082 macosx-all
+java/beans/XMLEncoder/javax_swing_JSplitPane.java               8173082 macosx-all
+java/beans/XMLEncoder/javax_swing_JTree.java                    8173082 macosx-all
+java/beans/XMLEncoder/javax_swing_OverlayLayout.java            8173082 macosx-all
+java/beans/XMLEncoder/javax_swing_border_TitledBorder.java      8173082 macosx-all
+java/beans/XMLEncoder/javax_swing_plaf_BorderUIResource_TitledBorderUIResource.java 8173082 macosx-all
 
 ############################################################################
 
@@ -258,6 +287,8 @@
 
 tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java       8169971 windows-x64
 
+tools/jlink/CustomPluginTest.java                               8172864 generic-all
+
 tools/jmod/JmodTest.java                                        8172870 windows-all
 
 ############################################################################
--- a/jdk/test/TEST.ROOT	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/TEST.ROOT	Sat Jan 21 03:53:21 2017 +0000
@@ -26,8 +26,8 @@
 # Allow querying of various System properties in @requires clauses
 requires.properties=sun.arch.data.model java.runtime.name
 
-# Tests using jtreg 4.2 b04 features
-requiredVersion=4.2 b04
+# Tests using jtreg 4.2 b05 features
+requiredVersion=4.2 b05
 
 # Path to libraries in the topmost test directory. This is needed so @library
 # does not need ../../ notation to reach them
--- a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy	Sat Jan 21 03:53:21 2017 +0000
@@ -1,6 +1,6 @@
-grant 
-{
+grant codeBase "file:${test.classes}/*" {
     permission java.security.SecurityPermission "removeProvider.SunJCE";
     permission java.security.SecurityPermission "insertProvider.SunJCE";
-    permission java.security.SecurityPermission "putProviderProperty.SunJCE";
+    permission java.lang.RuntimePermission
+               "accessClassInPackage.com.sun.crypto.provider";
 };
--- a/jdk/test/com/sun/security/auth/module/LdapLoginModule/CheckConfigs.policy	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/com/sun/security/auth/module/LdapLoginModule/CheckConfigs.policy	Sat Jan 21 03:53:21 2017 +0000
@@ -1,9 +1,9 @@
-
-grant {
+grant codeBase "file:${test.classes}/*" {
     // The following permissions are not required because the test is
     // not expected to connect to an LDAP server
     //
     //permission java.net.SocketPermission "*:389", "connect";
     //permission java.net.SocketPermission "*:636", "connect";
     //permission javax.security.auth.AuthPermission "modifyPrincipals";
+    permission java.lang.RuntimePermission "accessClassInPackage.com.sun.jndi.ldap";
 };
--- a/jdk/test/java/awt/Dialog/DialogAboveFrame/DialogAboveFrameTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/java/awt/Dialog/DialogAboveFrame/DialogAboveFrameTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8169589
+ * @bug 8169589 8171909
  * @summary Activating a dialog puts to back another dialog owned by the same frame
  * @author Dmitry Markov
  * @library ../../regtesthelpers
@@ -68,7 +68,7 @@
         int y = point.y + (int)(dialog1.getHeight() * 0.9);
 
         try {
-            if (!robot.getPixelColor(x, y).equals(dialog1.getBackground())) {
+            if (!Util.testPixelColor(x, y, dialog1.getBackground(), 10, 100, robot)) {
                 throw new RuntimeException("Test FAILED: Dialog is behind the frame");
             }
         } finally {
--- a/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,87 +23,174 @@
 
 /*
  *  @test
- *  @bug 6741606 7146431 8000450 8019830 8022945 8027144 8041633 8078427
- *  @summary Make sure all restricted packages listed in the package.access
+ *  @bug 6741606 7146431 8000450 8019830 8022945 8027144 8041633 8078427 8055206
+ *  @summary Check that various restricted packages that are supposed to be
+ *           restricted by default or are listed in the package.access
  *           property in the java.security file are blocked
+ *  @modules java.xml.ws java.corba
  *  @run main/othervm CheckPackageAccess
  */
 
-import java.util.Collections;
-import java.util.ArrayList;
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
+import java.util.Arrays;
 import java.util.List;
+import java.util.Optional;
+
+public class CheckPackageAccess {
+
+    private static final SecurityManager sm = new SecurityManager();
+    private static final ModuleFinder mf = ModuleFinder.ofSystem();
+
+    /*
+     * The expected list of restricted packages of the package.access property.
+     *
+     * This array should be updated whenever new packages are added to the
+     * package.access property in the java.security file
+     * NOTE: it should be in the same order as the java.security file
+     */
+    private static final String[] EXPECTED = {
+        "sun.misc.",
+        "sun.reflect.",
+    };
+
+    /**
+     * Tests access to various packages of a module.
+     */
+    private static class Test {
+        String moduleName;     // name of module
+        ModuleReference moduleRef;     // module reference
+        String exports;    // exported pkg
+        Optional<String> opens;      // opened pkg
+        String conceals;   // concealed pkg
+        Optional<String> qualExports; // qualified export pkg
+        Optional<String> qualOpens;   // qualified open pkg
+        // qual open and non-qualified export pkg
+        Optional<String> qualOpensAndExports;
+        Test(String module, String exports, String opens, String conceals,
+             String qualExports, String qualOpens, String qualOpensAndExports) {
+            this.moduleName = module;
+            this.moduleRef = mf.find(moduleName).get();
+            this.exports = exports;
+            this.opens = Optional.ofNullable(opens);
+            this.conceals = conceals;
+            this.qualExports = Optional.ofNullable(qualExports);
+            this.qualOpens = Optional.ofNullable(qualOpens);
+            this.qualOpensAndExports = Optional.ofNullable(qualOpensAndExports);
+        }
+
+        void test() {
+            System.out.println("Testing module " + moduleName);
+
+            // access to exported pkg should pass
+            testNonRestricted(exports);
+
+            // access to opened pkg should pass
+            opens.ifPresent(Test::testNonRestricted);
+
+            // access to concealed pkg should fail
+            testRestricted(conceals);
 
-/*
- * The main benefit of this test is to catch merge errors or other types
- * of issues where one or more of the packages are accidentally
- * removed. This is why the packages that are known to be restricted have to
- * be explicitly listed below.
- */
-public class CheckPackageAccess {
+            // access to qualified export pkg should fail
+            qualExports.ifPresent(Test::testRestricted);
+
+            // access to qualified open pkg should fail
+            qualOpens.ifPresent(Test::testRestricted);
+
+            // access to qualified opened pkg that is also exported should pass
+            qualOpensAndExports.ifPresent(Test::testNonRestricted);
+        }
+
+        private static void testRestricted(String pkg) {
+            try {
+                sm.checkPackageAccess(pkg);
+                throw new RuntimeException("Able to access restricted package: "
+                                           + pkg);
+            } catch (SecurityException se) {}
+            try {
+                sm.checkPackageDefinition(pkg);
+                throw new RuntimeException("Able to access restricted package: "
+                                           + pkg);
+            } catch (SecurityException se) {}
+        }
+
+        private static void testNonRestricted(String pkg) {
+            try {
+                sm.checkPackageAccess(pkg);
+            } catch (SecurityException se) {
+                throw new RuntimeException("Unable to access exported package: "
+                                           + pkg, se);
+            }
+            try {
+                sm.checkPackageDefinition(pkg);
+            } catch (SecurityException se) {
+                throw new RuntimeException("Unable to access exported package: "
+                                           + pkg, se);
+            }
+        }
+    }
+
+    private static final Test[] tests = new Test[] {
+        // java.base module loaded by boot loader
+        new Test("java.base", "java.security", null, "jdk.internal.jrtfs",
+                 "jdk.internal.loader", null, null),
+        // java.desktop module loaded by boot loader and has an openQual pkg
+        // that is exported
+        new Test("java.desktop", "java.applet", null, "sun.applet",
+                 "sun.awt", "com.sun.java.swing.plaf.windows",
+                 "javax.swing.plaf.basic"),
+        // java.security.jgss module loaded by platform loader
+        new Test("java.security.jgss", "org.ietf.jgss", null,
+                 "sun.security.krb5.internal.crypto", "sun.security.krb5",
+                 null, null),
+        // java.xml.ws module loaded by platform loader but needs to be added
+        // and has an openQual pkg that is exported
+        new Test("java.xml.ws", "javax.xml.soap", null,
+                 "com.sun.xml.internal.stream.buffer",
+                 "com.sun.xml.internal.ws.api", null,
+                 "javax.xml.ws.wsaddressing"),
+        // java.xml.ws module loaded by platform loader but needs to be added
+        // and has an openQual pkg
+        new Test("java.corba", "javax.rmi", null, "sun.corba",
+                 "com.sun.corba.se.impl.util", "com.sun.jndi.cosnaming", null),
+    };
 
     public static void main(String[] args) throws Exception {
-        // get expected list of restricted packages
-        List<String> pkgs = RestrictedPackages.expected();
 
-        // get actual list of restricted packages
-        List<String> jspkgs = RestrictedPackages.actual();
+        // check expected list of restricted packages in java.security file
+        checkPackages(Arrays.asList(EXPECTED));
 
-        if (!isOpenJDKOnly()) {
-            String lastPkg = pkgs.get(pkgs.size() - 1);
-
-            // Remove any closed packages from list before comparing
-            int index = jspkgs.indexOf(lastPkg);
-            if (index != -1 && index != jspkgs.size() - 1) {
-                jspkgs.subList(index + 1, jspkgs.size()).clear();
-            }
+        // check access to each module's packages
+        for (Test test : tests) {
+            test.test();
         }
 
-        // Sort to ensure lists are comparable
-        Collections.sort(pkgs);
-        Collections.sort(jspkgs);
+        System.out.println("Test passed");
+    }
 
-        if (!pkgs.equals(jspkgs)) {
-            for (String p : pkgs)
-                if (!jspkgs.contains(p))
-                    System.out.println("In golden set, but not in j.s file: " + p);
-            for (String p : jspkgs)
-                if (!pkgs.contains(p))
-                    System.out.println("In j.s file, but not in golden set: " + p);
-
-
-            throw new RuntimeException("restricted packages are not " +
-                                       "consistent with java.security file");
-        }
-        System.setSecurityManager(new SecurityManager());
-        SecurityManager sm = System.getSecurityManager();
+    private static void checkPackages(List<String> pkgs) {
         for (String pkg : pkgs) {
-            String subpkg = pkg + "foo";
             try {
                 sm.checkPackageAccess(pkg);
                 throw new RuntimeException("Able to access " + pkg +
                                            " package");
             } catch (SecurityException se) { }
             try {
-                sm.checkPackageAccess(subpkg);
-                throw new RuntimeException("Able to access " + subpkg +
-                                           " package");
-            } catch (SecurityException se) { }
-            try {
                 sm.checkPackageDefinition(pkg);
                 throw new RuntimeException("Able to define class in " + pkg +
                                            " package");
             } catch (SecurityException se) { }
+            String subpkg = pkg + "foo";
+            try {
+                sm.checkPackageAccess(subpkg);
+                throw new RuntimeException("Able to access " + subpkg +
+                                           " package");
+            } catch (SecurityException se) { }
             try {
                 sm.checkPackageDefinition(subpkg);
-                throw new RuntimeException("Able to define class in " + subpkg +
-                                           " package");
+                throw new RuntimeException("Able to define class in " +
+                                           subpkg + " package");
             } catch (SecurityException se) { }
         }
-        System.out.println("Test passed");
-    }
-
-    private static boolean isOpenJDKOnly() {
-        String prop = System.getProperty("java.runtime.name");
-        return prop != null && prop.startsWith("OpenJDK");
     }
 }
--- a/jdk/test/java/lang/SecurityManager/CheckPackageMatching.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/java/lang/SecurityManager/CheckPackageMatching.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,11 +28,13 @@
  * @run main/othervm CheckPackageMatching
  */
 
+import java.security.Security;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import java.util.StringTokenizer;
 
 /*
  * The purpose of this test is not to verify the content of the package
@@ -46,10 +48,23 @@
      * The restricted packages listed in the package.access property of the
      * java.security file.
      */
-    private static final String[] packages =
-        RestrictedPackages.actual().toArray(new String[0]);
+    private static final String[] packages = actual().toArray(new String[0]);
 
-    private static final boolean OPEN_JDK = isOpenJDKOnly();
+    /**
+     * Returns the list of restricted packages in the package.access property.
+     */
+    private static List<String> actual() {
+        String prop = Security.getProperty("package.access");
+        List<String> packages = new ArrayList<>();
+        if (prop != null && !prop.equals("")) {
+            StringTokenizer tok = new StringTokenizer(prop, ",");
+            while (tok.hasMoreElements()) {
+                String s = tok.nextToken().trim();
+                packages.add(s);
+            }
+        }
+        return packages;
+    }
 
     /**
      * PackageMatcher implements a state machine that matches package
@@ -326,13 +341,8 @@
         System.getSecurityManager().checkPackageAccess("com.sun.jmxa");
         System.getSecurityManager().checkPackageAccess("jmx");
         List<String> actual = Arrays.asList(packages);
-        for (String p : actual) {
-            if (!actual.contains(p)) {
-                System.err.println("Warning: '" + p + " not in package.access");
-            }
-        }
-        if (!actual.contains("sun.")) {
-            throw new Error("package.access does not contain 'sun.'");
+        if (!actual.contains("sun.misc.")) {
+            throw new Error("package.access does not contain 'sun.misc.'");
         }
     }
 
@@ -447,17 +457,15 @@
 
         // These should not match.
         for (String pkg : new String[] {"gloups.machin", "su",
-                                        "org.jcp.xml.dsig.interna",
+                                        "org.jcp.xml.dsig.inter",
                                         "com.sun.jm", "com.sun.jmxa"}) {
             testMatch(matcher, pkg, false, true);
         }
 
         // These should match.
         for (String pkg : Arrays.asList(
-                new String[] {"sun.gloups.machin", "sun", "sun.com",
-                              "com.sun.jmx", "com.sun.jmx.a",
-                              "org.jcp.xml.dsig.internal",
-                              "org.jcp.xml.dsig.internal.foo"})) {
+                new String[] {"sun.misc.gloups.machin", "sun.misc",
+                              "sun.reflect"})) {
             testMatch(matcher, pkg, true, true);
         }
 
@@ -486,12 +494,6 @@
         }
 
         for (String pkg : pkgs) {
-            if (!OPEN_JDK && pkg.equals("com.sun.media.sound.")) {
-                // don't test com.sun.media.sound since there is an entry
-                // for com.sun.media in non OpenJDK builds. Otherwise,
-                // the test for this package will fail unexpectedly.
-                continue;
-            }
             String candidate = pkg.substring(0, pkg.length() - 2);
             boolean expected = pkglist.contains(candidate + ".");
             testMatch(matcher, candidate, expected,
@@ -537,9 +539,4 @@
             }
         }
     }
-
-    private static boolean isOpenJDKOnly() {
-        String prop = System.getProperty("java.runtime.name");
-        return prop != null && prop.startsWith("OpenJDK");
-    }
 }
--- a/jdk/test/java/lang/SecurityManager/RestrictedPackages.java	Wed Jul 05 22:43:19 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.security.Security;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.StringTokenizer;
-
-/**
- * A collection of utility methods and constants for testing the package
- * access and package definition security checks.
- */
-final class RestrictedPackages {
-
-    /*
-     * The expected list of restricted packages.
-     *
-     * This array should be updated whenever new packages are added to the
-     * package.access property in the java.security file
-     * NOTE: it should be in the same order as the java.security file
-     */
-    static final String[] EXPECTED = {
-        "sun.",
-        "com.sun.xml.internal.",
-        "com.sun.imageio.",
-        "com.sun.istack.internal.",
-        "com.sun.jmx.",
-        "com.sun.media.sound.",
-        "com.sun.naming.internal.",
-        "com.sun.proxy.",
-        "com.sun.corba.se.",
-        "com.sun.org.apache.bcel.internal.",
-        "com.sun.org.apache.regexp.internal.",
-        "com.sun.org.apache.xerces.internal.",
-        "com.sun.org.apache.xpath.internal.",
-        "com.sun.org.apache.xalan.internal.extensions.",
-        "com.sun.org.apache.xalan.internal.lib.",
-        "com.sun.org.apache.xalan.internal.res.",
-        "com.sun.org.apache.xalan.internal.templates.",
-        "com.sun.org.apache.xalan.internal.utils.",
-        "com.sun.org.apache.xalan.internal.xslt.",
-        "com.sun.org.apache.xalan.internal.xsltc.cmdline.",
-        "com.sun.org.apache.xalan.internal.xsltc.compiler.",
-        "com.sun.org.apache.xalan.internal.xsltc.trax.",
-        "com.sun.org.apache.xalan.internal.xsltc.util.",
-        "com.sun.org.apache.xml.internal.res.",
-        "com.sun.org.apache.xml.internal.security.",
-        "com.sun.org.apache.xml.internal.serializer.dom3.",
-        "com.sun.org.apache.xml.internal.serializer.utils.",
-        "com.sun.org.apache.xml.internal.utils.",
-        "com.sun.org.glassfish.",
-        "com.sun.tools.script.",
-        "com.oracle.xmlns.internal.",
-        "com.oracle.webservices.internal.",
-        "org.jcp.xml.dsig.internal.",
-        "jdk.internal.",
-        "jdk.nashorn.internal.",
-        "jdk.nashorn.tools.",
-        "jdk.tools.jimage.",
-        "com.sun.activation.registries.",
-        "com.sun.java.accessibility.util.internal."
-    };
-
-    /*
-     * A non-exhaustive list of restricted packages.
-     *
-     * Contrary to what is in the EXPECTED list, this list does not need
-     * to be exhaustive.
-     */
-    static final String[] EXPECTED_NONEXHAUSTIVE = {
-        "sun.",
-        "com.sun.xml.internal.",
-        "com.sun.imageio.",
-        "com.sun.istack.internal.",
-        "com.sun.jmx.",
-        "com.sun.proxy.",
-        "com.sun.org.apache.bcel.internal.",
-        "com.sun.org.apache.regexp.internal.",
-        "com.sun.org.apache.xerces.internal.",
-        "com.sun.org.apache.xpath.internal.",
-        "com.sun.org.apache.xalan.internal.extensions.",
-        "com.sun.org.apache.xalan.internal.lib.",
-        "com.sun.org.apache.xalan.internal.res.",
-        "com.sun.org.apache.xalan.internal.templates.",
-        "com.sun.org.apache.xalan.internal.utils.",
-        "com.sun.org.apache.xalan.internal.xslt.",
-        "com.sun.org.apache.xalan.internal.xsltc.cmdline.",
-        "com.sun.org.apache.xalan.internal.xsltc.compiler.",
-        "com.sun.org.apache.xalan.internal.xsltc.trax.",
-        "com.sun.org.apache.xalan.internal.xsltc.util.",
-        "com.sun.org.apache.xml.internal.res.",
-        "com.sun.org.apache.xml.internal.serializer.utils.",
-        "com.sun.org.apache.xml.internal.utils.",
-        "com.sun.org.apache.xml.internal.security.",
-        "com.sun.org.glassfish.",
-        "org.jcp.xml.dsig.internal."
-    };
-
-    private static final String OS_NAME = System.getProperty("os.name");
-
-    /**
-     * Returns a list of expected restricted packages, including any
-     * OS specific packages. The returned list is mutable.
-     */
-    static List<String> expected() {
-        List<String> pkgs = new ArrayList<>(Arrays.asList(EXPECTED));
-        if (OS_NAME.contains("OS X")) {
-            pkgs.add("apple.");  // add apple package for OS X
-        }
-        if (OS_NAME.contains("Win")) {
-            pkgs.add("com.sun.java.accessibility.internal.");  // add Win only package
-        }
-        return pkgs;
-    }
-
-    /**
-     * Returns a list of actual restricted packages. The returned list
-     * is mutable.
-     */
-    static List<String> actual() {
-        String prop = Security.getProperty("package.access");
-        List<String> packages = new ArrayList<>();
-        if (prop != null && !prop.equals("")) {
-            StringTokenizer tok = new StringTokenizer(prop, ",");
-            while (tok.hasMoreElements()) {
-                String s = tok.nextToken().trim();
-                packages.add(s);
-            }
-        }
-        return packages;
-    }
-
-    private RestrictedPackages() { }
-}
--- a/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,6 +63,7 @@
         scratch.add("        int foo();");
         scratch.add("    }");
         scratch.add("    public static void main(String[] args) {");
+        scratch.add("        System.setSecurityManager(new SecurityManager());");
         scratch.add("        I lam = () -> 10;");
         scratch.add("        Runnable r = () -> {");
         scratch.add("            System.out.println(\"Runnable\");");
@@ -114,7 +115,6 @@
     public void testNotLogging() {
         TestResult tr = doExec(JAVA_CMD.getAbsolutePath(),
                                "-cp", ".",
-                               "-Djava.security.manager",
                                "com.example.TestLambda");
         tr.assertZero("Should still return 0");
     }
@@ -125,7 +125,6 @@
         TestResult tr = doExec(JAVA_CMD.getAbsolutePath(),
                                "-cp", ".",
                                "-Djdk.internal.lambda.dumpProxyClasses=dump",
-                               "-Djava.security.manager",
                                "com.example.TestLambda");
         // 2 our own class files. We don't care about the others
         assertEquals(Files.find(
@@ -143,7 +142,6 @@
         TestResult tr = doExec(JAVA_CMD.getAbsolutePath(),
                                "-cp", ".",
                                "-Djdk.internal.lambda.dumpProxyClasses=notExist",
-                               "-Djava.security.manager",
                                "com.example.TestLambda");
         assertEquals(tr.testOutput.stream()
                                   .filter(s -> s.startsWith("WARNING"))
@@ -159,7 +157,6 @@
         TestResult tr = doExec(JAVA_CMD.getAbsolutePath(),
                                "-cp", ".",
                                "-Djdk.internal.lambda.dumpProxyClasses=file",
-                               "-Djava.security.manager",
                                "com.example.TestLambda");
         assertEquals(tr.testOutput.stream()
                                   .filter(s -> s.startsWith("WARNING"))
@@ -218,7 +215,6 @@
             TestResult tr = doExec(JAVA_CMD.getAbsolutePath(),
                                    "-cp", ".",
                                    "-Djdk.internal.lambda.dumpProxyClasses=readOnly",
-                                   "-Djava.security.manager",
                                    "com.example.TestLambda");
             assertEquals(tr.testOutput.stream()
                                       .filter(s -> s.startsWith("WARNING"))
@@ -237,7 +233,6 @@
         TestResult tr = doExec(JAVA_CMD.getAbsolutePath(),
                                "-cp", ".",
                                "-Djdk.internal.lambda.dumpProxyClasses=dumpLong",
-                               "-Djava.security.manager",
                                longFQCN);
         assertEquals(tr.testOutput.stream()
                                   .filter(s -> s.startsWith("WARNING: Exception"))
--- a/jdk/test/java/nio/channels/Selector/SelectTimeout.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/java/nio/channels/Selector/SelectTimeout.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,46 +1,50 @@
 /*
-* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* This code is free software; you can redistribute it and/or modify it
-* under the terms of the GNU General Public License version 2 only, as
-* published by the Free Software Foundation.
-*
-* This code is distributed in the hope that it will be useful, but WITHOUT
-* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-* version 2 for more details (a copy is included in the LICENSE file that
-* accompanied this code).
-*
-* You should have received a copy of the GNU General Public License version
-* 2 along with this work; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-*
-* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-* or visit www.oracle.com if you need additional information or have any
-* questions.
-*/
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
 
 /*
  * @test
- * @bug 8165000
- * @summary Verify no IOException on OS X for large timeout value in select().
- * @requires (os.family == "mac")
+ * @bug 8165000 8172547
+ * @summary Verify no IOException on OS X for large timeout value in select()
+ * and that timeout does not occur too early on Windows.
+ * @requires (os.family == "mac" | os.family == "windows")
  */
 import java.io.IOException;
 import java.nio.channels.Selector;
 
 public class SelectTimeout {
-    private static final long HUGE_TIMEOUT = 100000001000L;
-    private static final long SLEEP_MILLIS = 10000;
+    private static final long BIG_TIMEOUT    = 100_000_001_000L; // 8165000
+    private static final long BIGGER_TIMEOUT = 850_000_000_000_000L; // 8172547
+    private static final long SLEEP_MILLIS   = 10000;
 
-    private static Exception theException;
+    private static volatile Exception theException;
+    private static volatile boolean isTimedOut;
 
     public static void main(String[] args)
         throws IOException, InterruptedException {
         int failures = 0;
         long[] timeouts =
-            new long[] {0, HUGE_TIMEOUT/2, HUGE_TIMEOUT - 1, HUGE_TIMEOUT};
+            new long[] {1, BIG_TIMEOUT/2, BIG_TIMEOUT - 1, BIG_TIMEOUT,
+                BIGGER_TIMEOUT};
         for (long t : timeouts) {
             if (!test(t)) {
                 failures++;
@@ -61,23 +65,35 @@
 
         Thread t = new Thread(() -> {
             try {
+                isTimedOut = false;
                 selector.select(timeout);
+                isTimedOut = true;
             } catch (IOException ioe) {
                 theException = ioe;
             }
         });
         t.start();
 
-        Thread.currentThread().sleep(SLEEP_MILLIS);
-        t.interrupt();
+        t.join(SLEEP_MILLIS);
 
+        boolean result;
         if (theException == null) {
-            System.out.printf("Test succeeded with timeout %d%n", timeout);
-            return true;
+            if (timeout > SLEEP_MILLIS && isTimedOut) {
+                System.err.printf("Test timed out early with timeout %d%n",
+                    timeout);
+                result = false;
+            } else {
+                System.out.printf("Test succeeded with timeout %d%n", timeout);
+                result = true;
+            }
         } else {
             System.err.printf("Test failed with timeout %d%n", timeout);
             theException.printStackTrace();
-            return false;
+            result = false;
         }
+
+        t.interrupt();
+
+        return result;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/rmi/MarshalledObject/MOFilterTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InvalidClassException;
+import java.io.ObjectInput;
+import java.io.ObjectInputStream;
+import java.io.ObjectInputFilter;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.rmi.MarshalledObject;
+import java.util.Objects;
+
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.testng.annotations.DataProvider;
+
+/* @test
+ * @run testng/othervm  MOFilterTest
+ *
+ * @summary Test MarshalledObject applies ObjectInputFilter
+ */
+@Test
+public class MOFilterTest {
+
+    /**
+     * Two cases are tested.
+     * The filter = null and a filter set to verify the calls to the filter.
+     * @return array objects with test parameters for each test case
+     */
+    @DataProvider(name = "FilterCases")
+    public static Object[][] filterCases() {
+        return new Object[][] {
+                {true},     // run the test with the filter
+                {false},    // run the test without the filter
+
+        };
+    }
+
+    /**
+     * Test that MarshalledObject inherits the ObjectInputFilter from
+     * the stream it was deserialized from.
+     */
+    @Test(dataProvider="FilterCases")
+    static void delegatesToMO(boolean withFilter) {
+        try {
+            Serializable testobj = Integer.valueOf(5);
+            MarshalledObject<Serializable> mo = new MarshalledObject<>(testobj);
+            Assert.assertEquals(mo.get(), testobj, "MarshalledObject.get returned a non-equals test object");
+
+            byte[] bytes = writeObjects(mo);
+
+            try (ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+                 ObjectInputStream ois = new ObjectInputStream(bais)) {
+
+                CountingFilter filter1 = new CountingFilter();
+                ois.setObjectInputFilter(withFilter ? filter1 : null);
+                MarshalledObject<?> actualMO = (MarshalledObject<?>)ois.readObject();
+                int count = filter1.getCount();
+
+                actualMO.get();
+                int expectedCount = withFilter ? count + 2 : count;
+                int actualCount = filter1.getCount();
+                Assert.assertEquals(actualCount, expectedCount, "filter called wrong number of times during get()");
+            }
+        } catch (IOException ioe) {
+            Assert.fail("Unexpected IOException", ioe);
+        } catch (ClassNotFoundException cnf) {
+            Assert.fail("Deserializing", cnf);
+        }
+    }
+
+    /**
+     * Write objects and return a byte array with the bytes.
+     *
+     * @param objects zero or more objects to serialize
+     * @return the byte array of the serialized objects
+     * @throws IOException if an exception occurs
+     */
+    static byte[] writeObjects(Object... objects)  throws IOException {
+        byte[] bytes;
+        try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
+             ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+            for (Object o : objects) {
+                oos.writeObject(o);
+            }
+            bytes = baos.toByteArray();
+        }
+        return bytes;
+    }
+
+
+    static class CountingFilter implements ObjectInputFilter {
+
+        private int count;      // count of calls to the filter
+
+        CountingFilter() {
+            count = 0;
+        }
+
+        int getCount() {
+            return count;
+        }
+
+        /**
+         * Filter that rejects class Integer and allows others
+         *
+         * @param filterInfo access to the class, arrayLength, etc.
+         * @return {@code STATUS.REJECTED}
+         */
+        public ObjectInputFilter.Status checkInput(FilterInfo filterInfo) {
+            count++;
+            return ObjectInputFilter.Status.ALLOWED;
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/rmi/registry/serialFilter/RegistryFilterTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.rmi.MarshalledObject;
+import java.rmi.NotBoundException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.AlreadyBoundException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.util.Objects;
+import java.security.Security;
+
+import org.testng.Assert;
+import org.testng.TestNG;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+/*
+ * @test
+ * @library /java/rmi/testlibrary
+ * @modules java.rmi/sun.rmi.registry
+ *          java.rmi/sun.rmi.server
+ *          java.rmi/sun.rmi.transport
+ *          java.rmi/sun.rmi.transport.tcp
+ * @build TestLibrary
+ * @summary Test filters for the RMI Registry
+ * @run testng/othervm RegistryFilterTest
+ * @run testng/othervm
+ *        -Dsun.rmi.registry.registryFilter=!java.lang.Long;!RegistryFilterTest$RejectableClass
+ *        RegistryFilterTest
+ * @run testng/othervm/policy=security.policy
+ *        -Djava.security.properties=${test.src}/java.security-extra1
+ *        RegistryFilterTest
+ */
+public class RegistryFilterTest {
+    private static Registry impl;
+    private static int port;
+    private static Registry registry;
+
+    static final int REGISTRY_MAX_ARRAY = 10000;
+
+    static final String registryFilter =
+            System.getProperty("sun.rmi.registry.registryFilter",
+                    Security.getProperty("sun.rmi.registry.registryFilter"));
+
+    @DataProvider(name = "bindAllowed")
+    static Object[][] bindAllowedObjects() {
+        Object[][] objects = {
+        };
+        return objects;
+    }
+
+    /**
+     * Data RMI Regiry bind test.
+     * - name
+     * - Object
+     * - true/false if object is blacklisted by a filter (implicit or explicit)
+     * @return array of test data
+     */
+    @DataProvider(name = "bindData")
+    static Object[][] bindObjects() {
+        Object[][] data = {
+                { "byte[max]", new XX(new byte[REGISTRY_MAX_ARRAY]), false },
+                { "String", new XX("now is the time"), false},
+                { "String[]", new XX(new String[3]), false},
+                { "Long[4]", new XX(new Long[4]), registryFilter != null },
+                { "rej-byte[toobig]", new XX(new byte[REGISTRY_MAX_ARRAY + 1]), true },
+                { "rej-MarshalledObject", createMarshalledObject(), true },
+                { "rej-RejectableClass", new RejectableClass(), registryFilter != null},
+        };
+        return data;
+    }
+
+    static XX createMarshalledObject() {
+        try {
+            return new XX(new MarshalledObject<>(null));
+        } catch (IOException ioe) {
+            return new XX(ioe);
+        }
+    }
+
+    @BeforeSuite
+    static void setupRegistry() {
+        try {
+            impl = TestLibrary.createRegistryOnEphemeralPort();
+            port = TestLibrary.getRegistryPort(impl);
+            registry = LocateRegistry.getRegistry("localhost", port);
+        } catch (RemoteException ex) {
+            Assert.fail("initialization of registry", ex);
+        }
+
+        System.out.printf("RMI Registry filter: %s%n", registryFilter);
+    }
+
+
+    /*
+     * Test registry rejects an object with the max array size  + 1.
+     */
+    @Test(dataProvider="bindData")
+    public void simpleBind(String name, Remote obj, boolean blacklisted) throws RemoteException, AlreadyBoundException, NotBoundException {
+        try {
+            registry.bind(name, obj);
+            Assert.assertFalse(blacklisted, "Registry filter did not reject (but should have) ");
+            registry.unbind(name);
+        } catch (Exception rex) {
+            Assert.assertTrue(blacklisted, "Registry filter should not have rejected");
+        }
+    }
+
+    /*
+    * Test registry rejects an object with a well known class
+    * if blacklisted in the security properties.
+    */
+    @Test
+    public void simpleRejectableClass() throws RemoteException, AlreadyBoundException, NotBoundException {
+        RejectableClass r1 = null;
+        try {
+            String name = "reject1";
+            r1 = new RejectableClass();
+            registry.bind(name, r1);
+            registry.unbind(name);
+            Assert.assertNull(registryFilter, "Registry filter should not have rejected");
+        } catch (Exception rex) {
+            Assert.assertNotNull(registryFilter, "Registry filter should have rejected");
+        }
+    }
+
+    /**
+     * A simple Serializable Remote object that is passed by value.
+     * It and its contents are checked by the Registry serial filter.
+     */
+    static class XX implements Serializable, Remote {
+        private static final long serialVersionUID = 362498820763181265L;
+
+        final Object obj;
+
+        XX(Object obj) {
+            this.obj = obj;
+        }
+
+        public String toString() {
+            return super.toString() + "//" + Objects.toString(obj);
+        }
+    }
+    /**
+     * A simple Serializable Remote object that is passed by value.
+     * It and its contents are checked by the Registry serial filter.
+     */
+    static class RejectableClass implements Serializable, Remote {
+        private static final long serialVersionUID = 362498820763181264L;
+
+        RejectableClass() {}
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/rmi/registry/serialFilter/java.security-extra1	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,9 @@
+# RMI Registry Input Serial Filter
+#
+# The filter pattern uses the same format as java.io.ObjectInputStream.serialFilter.
+# This filter can override the builtin filter if additional types need to be
+# allowed or rejected from the RMI Registry.
+#
+#sun.rmi.registry.registryFilter=pattern,pattern
+sun.rmi.registry.registryFilter=!java.lang.Long;!RegistryFilterTest$RejectableClass
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/rmi/registry/serialFilter/security.policy	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,4 @@
+grant {
+        permission java.security.AllPermission;
+};
+
--- a/jdk/test/java/security/KeyRep/SerialOld.policy	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/java/security/KeyRep/SerialOld.policy	Sat Jan 21 03:53:21 2017 +0000
@@ -1,4 +1,4 @@
-grant {
+grant codeBase "file:${test.classes}/*" {
 
     permission java.io.FilePermission "${test.src}${file.separator}*", "read";
     permission java.util.PropertyPermission "test.src", "read";
@@ -11,4 +11,6 @@
         "accessClassInPackage.sun.security.x509";
     permission java.lang.RuntimePermission
         "accessClassInPackage.sun.security.rsa";
+    permission java.lang.RuntimePermission
+        "accessClassInPackage.com.sun.crypto.provider";
 };
--- a/jdk/test/java/util/ResourceBundle/ResourceBundleTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/java/util/ResourceBundle/ResourceBundleTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  */
 /*
     @test
-    @bug 4049325 4073127 4083270 4106034 4108126 8027930
+    @bug 4049325 4073127 4083270 4106034 4108126 8027930 8171139
     @summary test Resource Bundle
     @build TestResource TestResource_de TestResource_fr TestResource_fr_CH
     @build TestResource_it FakeTestResource
@@ -65,6 +65,7 @@
 import java.util.*;
 import java.util.ResourceBundle.Control;
 import java.io.*;
+import java.net.URL;
 
 public class ResourceBundleTest extends RBTestFmwk {
     public static void main(String[] args) throws Exception {
@@ -330,6 +331,44 @@
         }
     }
 
+    /*
+     * @bug 8171139
+     * @summary Make sure clearCache() clears cached ResourceBundle instances
+     */
+    public void TestClearCache() {
+        final String className = "TestResource";
+        Locale loc = Locale.getDefault();
+
+        // testing no-arg clearCache()
+        ResourceBundle rb1 = ResourceBundle.getBundle(className, loc);
+        ResourceBundle.clearCache();
+        ResourceBundle rb2 = ResourceBundle.getBundle(className, loc);
+        if (rb1 == rb2) {
+            errln("clearCache(no-arg) did not clear cache");
+        }
+
+        // clearCache() with a custom classloader
+        ClassLoader cl1 = new DummyClassLoader();
+        rb1 = ResourceBundle.getBundle(className, loc, cl1);
+        if (rb1 == rb2) {
+            errln("Same bundle was returned for different class loaders");
+        }
+        ResourceBundle.clearCache(cl1);
+        rb2= ResourceBundle.getBundle(className, loc, cl1);
+        if (rb1 == rb2) {
+            errln("clearCache(classLoader) did not clear cache");
+        }
+        ClassLoader cl2 = new DummyClassLoader();
+        rb1 = ResourceBundle.getBundle(className, loc, cl2);
+        if (rb1 == rb2) {
+            errln("Same bundle was returned for different class loaders");
+        }
+        ResourceBundle.clearCache(cl1);
+        rb2 = ResourceBundle.getBundle(className, loc, cl2);
+        if (rb1 != rb2) {
+            errln("clearCache(classLoader) incorrectly cleared cache");
+        }
+    }
 
     private void makePropertiesFile() {
         try {
@@ -393,4 +432,22 @@
             errln("Wrong number of elements in key list: expected " + expectedKeys.length +
                 " got " + elementCount);
     }
+
+    private static class DummyClassLoader extends ClassLoader {
+        public DummyClassLoader() {
+            super(DummyClassLoader.class.getClassLoader());
+        }
+
+        public Class<?> loadClass(String name) throws ClassNotFoundException {
+            return DummyClassLoader.class.getClassLoader().loadClass(name);
+        }
+
+        public URL getResource(String name) {
+            return DummyClassLoader.class.getClassLoader().getResource(name);
+        }
+
+        public InputStream getResourceAsStream(String name) {
+            return DummyClassLoader.class.getClassLoader().getResourceAsStream(name);
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/modules/LogManagerInModule/LogManagerInModuleTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.nio.file.Paths;
+import java.util.logging.Handler;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
+
+/**
+ * @test
+ * @bug 8172886
+ * @summary Verifies that a custom LogManager or custom Handler can be
+ *          instantiated by the logging system if they are in a package
+ *          that is exported to java.logging by a module.
+ * @build test.logmanager/test.logmanager.TestLogManager
+ *        test.handlers/test.handlers.TestHandler
+ *        test.config/test.config.LogConfig
+ *        LogManagerInModuleTest
+ * @run main/othervm --add-modules test.logmanager,test.handlers
+ *          -Djava.util.logging.manager=test.logmanager.TestLogManager
+ *          LogManagerInModuleTest
+ * @run main/othervm --add-modules test.logmanager,test.handlers,test.config
+ *          -Djava.util.logging.manager=test.logmanager.TestLogManager
+ *          -Djava.util.logging.config.class=test.config.LogConfig
+ *          LogManagerInModuleTest
+ *
+ * @author danielfuchs
+ */
+public class LogManagerInModuleTest {
+
+    public static void main(String[] args) throws Exception {
+        if (System.getProperty("java.util.logging.config.class", null) == null) {
+            System.setProperty("java.util.logging.config.file",
+                Paths.get(System.getProperty("test.src", "src"),
+                          "logging.properties").toString());
+        }
+        // sanity check
+        if (LogManagerInModuleTest.class.getModule().isNamed()) {
+            throw new RuntimeException("Unexpected named module for "
+                  + LogManagerInModuleTest.class + ": "
+                  + LogManagerInModuleTest.class.getModule().getName());
+        }
+
+        // now check that the LogManager was correctly instantiated.
+        LogManager manager = LogManager.getLogManager();
+        System.out.println("LogManager: " + manager);
+        Class<?> logManagerClass = manager.getClass();
+        if (!"test.logmanager".equals(logManagerClass.getModule().getName())) {
+            throw new RuntimeException("Bad module for log manager: "
+                    + logManagerClass.getModule() + "; class is: "
+                    + logManagerClass.getName());
+        }
+
+        Logger logger = Logger.getLogger("com.xyz.foo");
+        Handler[] handlers = logger.getHandlers();
+        if (handlers.length != 1) {
+            throw new RuntimeException("Expected 1 handler, found " + handlers.length);
+        }
+        Class<?> handlerClass = handlers[0].getClass();
+        if (!"test.handlers".equals(handlerClass.getModule().getName())) {
+            throw new RuntimeException("Bad module for handler: "
+                    + handlerClass.getModule() + "; class is: "
+                    + handlerClass.getName());
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/modules/LogManagerInModule/logging.properties	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,56 @@
+############################################################
+#  	Global properties
+############################################################
+
+# "handlers" specifies a comma separated list of log Handler 
+# classes.  These handlers will be installed during VM startup.
+# Note that these classes must be on the system classpath.
+# By default we only configure a ConsoleHandler, which will only
+# show messages at the INFO and above levels.
+handlers= java.util.logging.ConsoleHandler
+
+# To also add the FileHandler, use the following line instead.
+#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+
+# Default global logging level.
+# This specifies which kinds of events are logged across
+# all loggers.  For any given facility this global level
+# can be overriden by a facility specific level
+# Note that the ConsoleHandler also has a separate level
+# setting to limit messages printed to the console.
+.level= INFO
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+# default file output is in user's home directory.
+java.util.logging.FileHandler.pattern = %h/java%u.log
+java.util.logging.FileHandler.limit = 50000
+java.util.logging.FileHandler.count = 1
+# Default number of locks FileHandler can obtain synchronously.
+# This specifies maximum number of attempts to obtain lock file by FileHandler
+# implemented by incrementing the unique field %u as per FileHandler API documentation.
+java.util.logging.FileHandler.maxLocks = 100
+java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
+
+# Limit the message that are printed on the console to INFO and above.
+java.util.logging.ConsoleHandler.level = INFO
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+# Example to customize the SimpleFormatter output format 
+# to print one-line log message like this:
+#     <level>: <log message> [<date/time>]
+#
+# java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n
+
+############################################################
+# Facility specific properties.
+# Provides extra control for each logger.
+############################################################
+
+# For example, set the com.xyz.foo logger to only log SEVERE
+# messages:
+com.xyz.foo.level = SEVERE
+com.xyz.foo.handlers = test.handlers.TestHandler
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/modules/LogManagerInModule/test.config/module-info.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module test.config {
+    requires java.logging;
+    requires test.handlers;
+    // makes it possible for java.logging to instantiate test.config.LogConfig;
+    // this doesn't need to be a qualified export, but making it so will prevent
+    // any other module from being able to instantiate the provided classes.
+    exports test.config to java.logging;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/modules/LogManagerInModule/test.config/test/config/LogConfig.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package test.config;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
+import test.handlers.TestHandler;
+
+/**
+ * A dummy class that configures the logging system.
+ * @author danielfuchs
+ */
+public class LogConfig {
+    private static final List<Logger> LOGGERS = new ArrayList<>();
+    public LogConfig() {
+        LogManager manager = LogManager.getLogManager();
+        Logger logger = Logger.getLogger("com.xyz.foo");
+        if (logger.getHandlers().length > 0) {
+            System.err.println(this.getClass().getName() + ": "
+                    + "Unexpected handlers: "
+                    + List.of(logger.getHandlers()));
+            throw new RuntimeException("Unexpected handlers: "
+                    + List.of(logger.getHandlers()));
+        }
+        logger.addHandler(new TestHandler());
+        LOGGERS.add(logger);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/modules/LogManagerInModule/test.handlers/module-info.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module test.handlers {
+    requires transitive java.logging;
+    // makes it possible for java.logging and test.config to instantiate
+    // test.handlers.TestHandler;
+    // this doesn't need to be a qualified export, but making it so will prevent
+    // any other module from being able to instantiate the provided classes.
+    exports test.handlers to java.logging, test.config;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/modules/LogManagerInModule/test.handlers/test/handlers/TestHandler.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package test.handlers;
+
+import java.util.logging.Handler;
+import java.util.logging.LogRecord;
+
+/**
+ * A dummy Handler that does nothing.
+ * @author danielfuchs
+ */
+public class TestHandler extends Handler {
+
+    @Override
+    public void publish(LogRecord record) {
+    }
+
+    @Override
+    public void flush() {
+    }
+
+    @Override
+    public void close() throws SecurityException {
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/modules/LogManagerInModule/test.logmanager/module-info.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module test.logmanager {
+    requires java.logging;
+    // makes it possible for java.logging to instantiate
+    // test.logmanager.TestLogManager;
+    // this doesn't need to be a qualified export, but making it so will prevent
+    // any other module from being able to instantiate the provided classes.
+    exports test.logmanager to java.logging;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/modules/LogManagerInModule/test.logmanager/test/logmanager/TestLogManager.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package test.logmanager;
+
+import java.util.logging.LogManager;
+
+/**
+ * A dummy LogManager that simply extends the standard class.
+ * @author danielfuchs
+ */
+public class TestLogManager extends LogManager {
+
+}
--- a/jdk/test/javax/net/ssl/SSLParameters/UseCipherSuitesOrder.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/javax/net/ssl/SSLParameters/UseCipherSuitesOrder.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
  * @bug 7188657
  * @summary There should be a way to reorder the JSSE ciphers
  * @run main/othervm UseCipherSuitesOrder
- *     TLS_RSA_WITH_AES_128_CBC_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA
+ *     TLS_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA
  */
 
 import java.io.*;
--- a/jdk/test/javax/rmi/PortableRemoteObject/8146975/jtreg.test.policy	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/javax/rmi/PortableRemoteObject/8146975/jtreg.test.policy	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,25 +21,12 @@
  * questions.
  */
 
-grant codeBase "jrt:/java.corba" {
-        permission java.security.AllPermission;
+grant {
+  permission java.util.PropertyPermission "*", "read";
+  permission java.io.FilePermission "<<ALL FILES>>", "read, execute";
 };
 
-
-
-grant {
-  permission java.io.FilePermission "./-", "read,write,execute";
-  permission java.io.FilePermission "*", "read";
+grant codeBase "file:${test.classes}/*" {
   permission java.net.SocketPermission "*:*", "connect, accept, listen, resolve";
-  permission java.util.PropertyPermission "*", "read, write";
-  permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
-  permission java.io.SerializablePermission "enableSubclassImplementation";
-  permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.misc";
-  permission java.lang.RuntimePermission "accessClassInPackage.sun.corba";
-  permission java.lang.RuntimePermission "defineClassInPackage.sun.corba";
-  permission java.lang.RuntimePermission "reflectionFactoryAccess";
-  permission sun.corba.BridgePermission "getBridge";
-  permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.reflect";
-  permission java.util.PropertyPermission "*", "read, write";
-  permission java.io.FilePermission "<<ALL FILES>>", "read,write,execute";
+  permission java.lang.RuntimePermission "accessClassInPackage.com.sun.jndi.cosnaming";
 };
--- a/jdk/test/javax/rmi/PortableRemoteObject/jtreg.test.policy	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/javax/rmi/PortableRemoteObject/jtreg.test.policy	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,23 +21,12 @@
  * questions.
  */
 
-grant codeBase "jrt:/java.corba" {
-        permission java.security.AllPermission;
+grant {
+  permission java.util.PropertyPermission "*", "read";
+  permission java.io.FilePermission "<<ALL FILES>>", "read, execute";
 };
 
-grant {
-  permission java.io.FilePermission "./-", "read,write,execute";
-  permission java.io.FilePermission "*", "read";
+grant codeBase "file:${test.classes}/*" {
   permission java.net.SocketPermission "*:*", "connect, accept, listen, resolve";
-  permission java.util.PropertyPermission "*", "read, write";
-  permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
-  permission java.io.SerializablePermission "enableSubclassImplementation";
-  permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.misc";
-  permission java.lang.RuntimePermission "accessClassInPackage.sun.corba";
-  permission java.lang.RuntimePermission "defineClassInPackage.sun.corba";
-  permission java.lang.RuntimePermission "reflectionFactoryAccess";
-  permission sun.corba.BridgePermission "getBridge";
-  permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.reflect";
-  permission java.util.PropertyPermission "*", "read, write";
-  permission java.io.FilePermission "<<ALL FILES>>", "read,write,execute";
+  permission java.lang.RuntimePermission "accessClassInPackage.com.sun.jndi.cosnaming";
 };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTree/4633594/JTreeFocusTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/* @test
+   @bug 4633594 8172012
+   @summary No way to pass focus from a JTree to a GUI placed inside the tree node
+   @run main JTreeFocusTest
+*/
+import java.awt.Component;
+import java.awt.GridLayout;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.KeyEvent;
+import java.util.EventObject;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.JTree;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.border.BevelBorder;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.LineBorder;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeCellEditor;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.DefaultTreeModel;
+
+public class JTreeFocusTest {
+
+    private static DefaultMutableTreeNode root;
+    Robot robot;
+    static boolean passed = false;
+    boolean rootSelected = false;
+    boolean keysTyped = false;
+    private volatile Point p = null;
+    private static JFrame fr;
+    private static volatile JTree tree = null;
+
+    public static void main(String[] args) throws Exception{
+         new JTreeFocusTest();
+    }
+
+    void blockTillDisplayed(JComponent comp) throws Exception {
+        while (p == null) {
+            try {
+                SwingUtilities.invokeAndWait(() -> {
+                    p = comp.getLocationOnScreen();
+                });
+            } catch (IllegalStateException e) {
+                try {
+                    Thread.sleep(1000);
+                } catch (InterruptedException ie) {
+                }
+            }
+        }
+    }
+
+    public JTreeFocusTest() throws Exception {
+        SwingUtilities.invokeAndWait(() -> {
+            fr = new JFrame("Test");
+
+            root = new DefaultMutableTreeNode("root");
+            JPanel p = new JPanel();
+            p.setBorder(new CompoundBorder(new BevelBorder(BevelBorder.RAISED),
+                    new LineBorder(UIManager.getColor("control"), 7)));
+            p.setLayout(new GridLayout(2,2));
+            p.add(new JLabel("one"));
+            JTextField tf1  = new JTextField(10);
+            p.add(tf1);
+            p.add(new JLabel("two"));
+            p.add(new JTextField(10));
+            root.add(new DefaultMutableTreeNode(p));
+
+            tf1.addFocusListener(new FocusAdapter() {
+                public void focusGained(FocusEvent e) {
+                    setPassed(true);
+                }
+            });
+
+            DefaultTreeModel model = new DefaultTreeModel(root);
+            tree = new JTree(model) {
+                public void processKeyEvent(KeyEvent e) {
+                    super.processKeyEvent(e);
+                    if (e.getKeyCode()==KeyEvent.VK_F2) {
+                        synchronized (JTreeFocusTest.this) {
+                            keysTyped = true;
+                            JTreeFocusTest.this.notifyAll();
+                        }
+                    }
+                }
+            };
+
+            tree.addTreeSelectionListener(new TreeSelectionListener() {
+                public void valueChanged(TreeSelectionEvent e) {
+                    if ( root.equals(e.getPath().getLastPathComponent()) ) {
+                        synchronized (JTreeFocusTest.this) {
+                            rootSelected = true;
+                            JTreeFocusTest.this.notifyAll();
+                        }
+                    }
+                }
+            });
+
+            tree.setEditable(true);
+            DefaultTreeCellRenderer renderer = new FormRenderer();
+            tree.setCellRenderer(renderer);
+            DefaultTreeCellEditor editor = new FormEditor(tree, renderer);
+            tree.setCellEditor(editor);
+            fr.getContentPane().add(tree);
+
+            fr.setSize(300,400);
+            fr.setVisible(true);
+        });
+        blockTillDisplayed(tree);
+        SwingUtilities.invokeAndWait(() -> {
+            tree.requestFocus();
+            tree.setSelectionRow(0);
+        });
+
+        try {
+            synchronized (this) {
+                while (!rootSelected) {
+                    JTreeFocusTest.this.wait();
+                }
+            }
+
+            robot = new Robot();
+            robot.setAutoDelay(50);
+            robot.delay(150);
+            robot.keyPress(KeyEvent.VK_DOWN);
+            robot.keyRelease(KeyEvent.VK_DOWN);
+            robot.keyPress(KeyEvent.VK_RIGHT);
+            robot.keyRelease(KeyEvent.VK_RIGHT);
+            robot.keyPress(KeyEvent.VK_F2);
+            robot.keyRelease(KeyEvent.VK_F2);
+
+            synchronized (this) {
+                while (!keysTyped) {
+                    JTreeFocusTest.this.wait();
+                }
+            }
+            Thread.sleep(3000);
+        } catch(Throwable t) {
+            t.printStackTrace();
+        }
+        destroy();
+    }
+
+    public void destroy() throws Exception {
+        SwingUtilities.invokeAndWait(()->fr.dispose());
+        if ( !isPassed() ) {
+            throw new RuntimeException("Focus wasn't transferred to the proper component");
+        }
+    }
+
+    synchronized void setPassed(boolean passed) {
+        this.passed = passed;
+    }
+
+    synchronized boolean isPassed() {
+        return passed;
+    }
+
+    static JTree createTree() {
+        return tree;
+    }
+
+    class FormRenderer extends DefaultTreeCellRenderer {
+        public Component getTreeCellRendererComponent(JTree tree, Object value,
+                                                      boolean sel,
+                                                      boolean expanded,
+                                                      boolean leaf, int row,
+                                                      boolean hasFocus) {
+            Object obj = ((DefaultMutableTreeNode)value).getUserObject();
+            if (obj instanceof Component){
+                return (Component)((DefaultMutableTreeNode)value).getUserObject();
+            }
+            return super.getTreeCellRendererComponent(tree, value, sel,
+                                                      expanded, leaf, row,
+                                                      hasFocus);
+        }
+    }
+
+    class FormEditor extends DefaultTreeCellEditor {
+        public FormEditor(JTree tree, DefaultTreeCellRenderer renderer) {
+            super(tree, renderer);
+        }
+
+        public Component getTreeCellEditorComponent(JTree tree, Object value,
+                                                      boolean sel,
+                                                      boolean expanded,
+                                                      boolean leaf, int row) {
+            Object obj = ((DefaultMutableTreeNode)value).getUserObject();
+            if (obj instanceof Component){
+                return (Component)((DefaultMutableTreeNode)value).getUserObject();
+            }
+            return super.getTreeCellEditorComponent(tree, value, sel,
+                                                    expanded, leaf, row);
+        }
+
+        public boolean shouldSelectCell(EventObject anEvent) {
+            //return super.shouldSelectCell(anEvent);
+            return true;
+        }
+    }
+}
--- a/jdk/test/jdk/nio/zipfs/PathOps.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/jdk/nio/zipfs/PathOps.java	Sat Jan 21 03:53:21 2017 +0000
@@ -31,7 +31,7 @@
 /**
  *
  * @test
- * @bug 8038500 8040059 8139956 8146754
+ * @bug 8038500 8040059 8139956 8146754 8172921
  * @summary Tests path operations for zip provider.
  *
  * @run main PathOps
@@ -180,6 +180,13 @@
         return this;
     }
 
+    PathOps resolvePath(String other, String expected) {
+        out.format("test resolve %s\n", other);
+        checkPath();
+        check(path.resolve(fs.getPath(other)), expected);
+        return this;
+    }
+
     PathOps resolveSibling(String other, String expected) {
         out.format("test resolveSibling %s\n", other);
         checkPath();
@@ -384,6 +391,30 @@
             .resolve("", "")
             .resolve("foo", "foo")
             .resolve("/foo", "/foo");
+        test("/")
+            .resolve("", "/")
+            .resolve("foo", "/foo")
+            .resolve("/foo", "/foo")
+            .resolve("/foo/", "/foo");
+
+        // resolve(Path)
+        test("/tmp")
+            .resolvePath("foo", "/tmp/foo")
+            .resolvePath("/foo", "/foo")
+            .resolvePath("", "/tmp");
+        test("tmp")
+            .resolvePath("foo", "tmp/foo")
+            .resolvePath("/foo", "/foo")
+            .resolvePath("", "tmp");
+        test("")
+            .resolvePath("", "")
+            .resolvePath("foo", "foo")
+            .resolvePath("/foo", "/foo");
+        test("/")
+            .resolvePath("", "/")
+            .resolvePath("foo", "/foo")
+            .resolvePath("/foo", "/foo")
+            .resolvePath("/foo/", "/foo");
 
         // resolveSibling
         test("foo")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/management/LoggingTest/LoggingTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.management.ManagementFactory;
+import java.util.List;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+public class LoggingTest {
+
+    static class TestStream extends PrintStream {
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        private volatile boolean recording;
+        public TestStream(PrintStream wrapped) {
+            super(wrapped);
+        }
+
+        void startRecording() {
+            recording = true;
+        }
+
+        void stopRecording() {
+            recording = false;
+        }
+
+        @Override
+        public void write(int b) {
+            if (recording) {
+                bos.write(b);
+            }
+            super.write(b);
+        }
+
+        @Override
+        public void write(byte[] buf, int off, int len) {
+            if (recording) {
+                bos.write(buf, off, len);
+            }
+            super.write(buf, off, len);
+        }
+
+        @Override
+        public void write(byte[] buf) throws IOException {
+            if (recording) {
+                bos.write(buf);
+            }
+            super.write(buf);
+        }
+
+    }
+
+    public void run(TestStream ts) {
+
+        // start recording traces and trigger creation of the platform
+        // MBeanServer to produce some. This won't work if the platform
+        // MBeanServer was already initialized - so it's important to
+        // run this test in its own JVM.
+        ts.startRecording();
+        MBeanServer platform = ManagementFactory.getPlatformMBeanServer();
+        ts.stopRecording();
+        String printed = ts.bos.toString();
+        ts.bos.reset();
+
+        // Check that the Platform MBeanServer is emitting the expected
+        // log traces. This can be a bit fragile because debug traces
+        // could be changed without notice - in which case this test will
+        // need to be updated.
+        // For each registered MBean we expect to see three traces.
+        // If the messages logged by the MBeanServer change then these checks
+        // may need to be revisited.
+        List<String> checkTraces =
+                List.of("ObjectName = %s", "name = %s", "JMX.mbean.registered %s");
+
+        for (ObjectName o : platform.queryNames(ObjectName.WILDCARD, null)) {
+            String n = o.toString();
+            System.out.println("Checking log for: " + n);
+            for (String check : checkTraces) {
+                String s = String.format(check, n);
+                if (!printed.contains(s)) {
+                    throw new RuntimeException("Trace not found: " + s);
+                }
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/management/LoggingTest/LoggingWithJULTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.nio.file.Paths;
+
+/**
+ * @test
+ * @bug 8172971
+ * @modules java.management java.logging
+ * @summary Smoke test to check that logging in java.management works as expected.
+ * @build LoggingTest LoggingWithJULTest
+ * @run main/othervm LoggingWithJULTest
+ * @author danielfuchs
+ */
+public class LoggingWithJULTest {
+
+    public static void main(String[] args) {
+        // Replace System.err
+        LoggingTest.TestStream ts = new LoggingTest.TestStream(System.err);
+        System.setErr(ts);
+
+        // activate the javax.management traces
+        String properties = Paths.get(System.getProperty("test.src", "src"),
+                                      "logging.properties").toString();
+        System.setProperty("java.util.logging.config.file", properties);
+
+        // run the test
+        new LoggingTest().run(ts);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/management/LoggingTest/LoggingWithLoggerFinderTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8172971
+ * @modules java.management
+ * @summary Smoke test to check that logging in java.management is performed
+ *          through System.Logger. This test installs a LoggerFinder service
+ *          provider and verifies that it gets the traces.
+ * @build test.loggerfinder/test.loggerfinder.TestLoggerFinder LoggingTest LoggingWithLoggerFinderTest
+ * @run main/othervm --add-modules test.loggerfinder LoggingWithLoggerFinderTest
+ * @author danielfuchs
+ */
+public class LoggingWithLoggerFinderTest {
+
+    public static void main(String[] args) {
+        // Replace System.err
+        LoggingTest.TestStream ts = new LoggingTest.TestStream(System.err);
+        System.setErr(ts);
+
+        // run the test
+        new LoggingTest().run(ts);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/management/LoggingTest/logging.properties	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,55 @@
+############################################################
+#  	Global properties
+############################################################
+
+# "handlers" specifies a comma separated list of log Handler 
+# classes.  These handlers will be installed during VM startup.
+# Note that these classes must be on the system classpath.
+# By default we only configure a ConsoleHandler, which will only
+# show messages at the INFO and above levels.
+handlers= java.util.logging.ConsoleHandler
+
+# To also add the FileHandler, use the following line instead.
+#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+
+# Default global logging level.
+# This specifies which kinds of events are logged across
+# all loggers.  For any given facility this global level
+# can be overriden by a facility specific level
+# Note that the ConsoleHandler also has a separate level
+# setting to limit messages printed to the console.
+.level= INFO
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+# default file output is in user's home directory.
+java.util.logging.FileHandler.pattern = %h/java%u.log
+java.util.logging.FileHandler.limit = 50000
+java.util.logging.FileHandler.count = 1
+# Default number of locks FileHandler can obtain synchronously.
+# This specifies maximum number of attempts to obtain lock file by FileHandler
+# implemented by incrementing the unique field %u as per FileHandler API documentation.
+java.util.logging.FileHandler.maxLocks = 100
+java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
+
+# Limit the message that are printed on the console to INFO and above.
+java.util.logging.ConsoleHandler.level = ALL
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+# Example to customize the SimpleFormatter output format 
+# to print one-line log message like this:
+#     <level>: <log message> [<date/time>]
+#
+# java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n
+
+############################################################
+# Facility specific properties.
+# Provides extra control for each logger.
+############################################################
+
+# For example, set the com.xyz.foo logger to only log SEVERE
+# messages:
+javax.management.level = ALL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/management/LoggingTest/test.loggerfinder/module-info.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module test.loggerfinder {
+    // Install a LoggerFinder that will direct traces directly to System.err,
+    // without involving java.util.logging
+    provides java.lang.System.LoggerFinder with test.loggerfinder.TestLoggerFinder;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/management/LoggingTest/test.loggerfinder/test/loggerfinder/TestLoggerFinder.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package test.loggerfinder;
+
+import java.lang.System.Logger;
+import java.lang.System.Logger.Level;
+import java.lang.System.LoggerFinder;
+import java.lang.reflect.Module;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Optional;
+import java.util.ResourceBundle;
+import java.util.function.Predicate;
+import java.lang.StackWalker.StackFrame;
+import java.text.MessageFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * A LoggerFinder that provides System.Logger which print directly
+ * on System.err, without involving java.logging.
+ * For the purpose of the test, loggers whose name start with java.management.
+ * will log all messages, and other loggers will only log level > INFO.
+ * @author danielfuchs
+ */
+public class TestLoggerFinder extends LoggerFinder {
+
+    static class TestLogger implements Logger {
+
+        final String name;
+
+        public TestLogger(String name) {
+            this.name = name;
+        }
+
+
+        @Override
+        public String getName() {
+            return name;
+        }
+
+        @Override
+        public boolean isLoggable(Level level) {
+            return name.equals("javax.management")
+                    || name.startsWith("javax.management.")
+                    || level.getSeverity() >= Level.INFO.getSeverity();
+        }
+
+        @Override
+        public void log(Level level, ResourceBundle bundle, String msg, Throwable thrown) {
+            if (!isLoggable(level)) return;
+            publish(level, bundle, msg, thrown);
+        }
+
+        @Override
+        public void log(Level level, ResourceBundle bundle, String format, Object... params) {
+            if (!isLoggable(level)) return;
+            publish(level, bundle, format, params);
+        }
+
+        static void publish(Level level, ResourceBundle bundle, String msg, Throwable thrown) {
+            StackFrame sf = new CallerFinder().get().get();
+
+            if (bundle != null && msg != null) {
+                msg = bundle.getString(msg);
+            }
+            if (msg == null) msg = "";
+            LocalDateTime ldt = LocalDateTime.now();
+            String date = DateTimeFormatter.ISO_DATE_TIME.format(ldt);
+            System.err.println(date + " "
+                    + sf.getClassName() + " " + sf.getMethodName() + "\n"
+                    + String.valueOf(level) + ": " + msg);
+            thrown.printStackTrace(System.err);
+        }
+
+        static void publish(Level level, ResourceBundle bundle, String format, Object... params) {
+            StackFrame sf = new CallerFinder().get().get();
+            if (bundle != null && format != null) {
+                format = bundle.getString(format);
+            }
+            String msg = format(format, params);
+            LocalDateTime ldt = LocalDateTime.now();
+            String date = DateTimeFormatter.ISO_DATE_TIME.format(ldt);
+            System.err.println(date + " "
+                    + sf.getClassName() + " " + sf.getMethodName() + "\n"
+                    + String.valueOf(level) + ": " + msg);
+        }
+
+        static String format(String format, Object... args) {
+            if (format == null) return "";
+            int index = 0, len = format.length();
+            while ((index = format.indexOf(index, '{')) >= 0) {
+                if (index >= len - 2) break;
+                char c = format.charAt(index+1);
+                if (c >= '0' && c <= '9') {
+                    return MessageFormat.format(format, args);
+                }
+                index++;
+            }
+            return format;
+        }
+
+    }
+
+     /*
+     * CallerFinder is a stateful predicate.
+     */
+    static final class CallerFinder implements Predicate<StackWalker.StackFrame> {
+        private static final StackWalker WALKER;
+        static {
+            PrivilegedAction<StackWalker> pa =
+                () -> StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE);
+            WALKER = AccessController.doPrivileged(pa);
+        }
+
+        /**
+         * Returns StackFrame of the caller's frame.
+         * @return StackFrame of the caller's frame.
+         */
+        Optional<StackWalker.StackFrame> get() {
+            return WALKER.walk((s) -> s.filter(this).findFirst());
+        }
+
+        private boolean lookingForLogger = true;
+        /**
+         * Returns true if we have found the caller's frame, false if the frame
+         * must be skipped.
+         *
+         * @param t The frame info.
+         * @return true if we have found the caller's frame, false if the frame
+         * must be skipped.
+         */
+        @Override
+        public boolean test(StackWalker.StackFrame s) {
+            // We should skip all frames until we have found the logger,
+            // because these frames could be frames introduced by e.g. custom
+            // sub classes of Handler.
+            Class<?> c = s.getDeclaringClass();
+            boolean isLogger = System.Logger.class.isAssignableFrom(c);
+            if (lookingForLogger) {
+                // Skip all frames until we have found the first logger frame.
+                lookingForLogger = c != TestLogger.class;
+                return false;
+            }
+            // Continue walking until we've found the relevant calling frame.
+            // Skips logging/logger infrastructure.
+            return !isLogger;
+        }
+    }
+
+    @Override
+    public Logger getLogger(String name, Module module) {
+        return new TestLogger(name);
+    }
+
+}
--- a/jdk/test/sun/security/tools/jarsigner/concise_jarsigner.sh	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/concise_jarsigner.sh	Sat Jan 21 03:53:21 2017 +0000
@@ -22,7 +22,7 @@
 #
 
 # @test
-# @bug 6802846
+# @bug 6802846 8172529
 # @summary jarsigner needs enhanced cert validation(options)
 #
 # @run shell/timeout=240 concise_jarsigner.sh
@@ -52,7 +52,7 @@
 KS=js.ks
 KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS -keyalg rsa -keysize 1024"
 JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
-JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -debug"
 JAVAC="$TESTJAVA${FS}bin${FS}javac ${TESTTOOLVMOPTS} ${TESTJAVACOPTS}"
 
 rm $KS
@@ -138,7 +138,7 @@
 [ $LINES = 4 ] || exit $LINENO
 
 # ==========================================================
-# Second part: exit code 2, 4, 8
+# Second part: exit code 2, 4, 8.
 # 16 and 32 already covered in the first part
 # ==========================================================
 
@@ -174,11 +174,14 @@
 $JARSIGNER -strict -keystore $KS -storepass changeit a.jar goodeku
 [ $? = 0 ] || exit $LINENO
 
-# badchain signed by ca, but ca is removed later
+# badchain signed by ca1, but ca1 is removed later
 $KT -genkeypair -alias badchain -dname CN=badchain -validity 365
-$KT -certreq -alias badchain | $KT -gencert -alias ca -validity 365 | \
+$KT -genkeypair -alias ca1 -dname CN=ca1 -ext bc -validity 365
+$KT -certreq -alias badchain | $KT -gencert -alias ca1 -validity 365 | \
         $KT -importcert -alias badchain
-$KT -delete -alias ca
+# save ca1.cert for easy replay
+$KT -exportcert -file ca1.cert -alias ca1
+$KT -delete -alias ca1
 
 $JARSIGNER -strict -keystore $KS -storepass changeit a.jar badchain
 [ $? = 4 ] || exit $LINENO
@@ -204,13 +207,41 @@
 $JARSIGNER -strict -keystore $KS -storepass changeit -certchain certchain a.jar altchain
 [ $? = 0 ] || exit $LINENO
 
-# but if ca2 is removed, -certchain does not work
+# if ca2 is removed, -certchain still work because altchain is a self-signed entry and
+# it is trusted by jarsigner
+# save ca2.cert for easy replay
+$KT -exportcert -file ca2.cert -alias ca2
 $KT -delete -alias ca2
 $JARSIGNER -strict -keystore $KS -storepass changeit -certchain certchain a.jar altchain
+[ $? = 0 ] || exit $LINENO
+
+# if cert is imported, -certchain won't work because this certificate entry is not trusted
+$KT -importcert -file certchain -alias altchain -noprompt
+$JARSIGNER -strict -keystore $KS -storepass changeit -certchain certchain a.jar altchain
 [ $? = 4 ] || exit $LINENO
 
 $JARSIGNER -verify a.jar
 [ $? = 0 ] || exit $LINENO
 
+# ==========================================================
+# 8172529
+# ==========================================================
+
+$KT -genkeypair -alias ee -dname CN=ee
+$KT -genkeypair -alias caone -dname CN=caone
+$KT -genkeypair -alias catwo -dname CN=catwo
+
+$KT -certreq -alias ee | $KT -gencert -alias catwo -rfc > ee.cert
+$KT -certreq -alias catwo | $KT -gencert -alias caone -sigalg MD5withRSA -rfc > catwo.cert
+
+# This certchain contains a cross-signed weak catwo.cert
+cat ee.cert catwo.cert | $KT -importcert -alias ee
+
+$JAR cvf a.jar A1.class
+$JARSIGNER -strict -keystore $KS -storepass changeit a.jar ee
+[ $? = 0 ] || exit $LINENO
+$JARSIGNER -strict -keystore $KS -storepass changeit -verify a.jar
+[ $? = 0 ] || exit $LINENO
+
 echo OK
 exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/tools/keytool/ImportPrompt.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.test.lib.Asserts;
+import jdk.test.lib.SecurityTools;
+import jdk.test.lib.process.OutputAnalyzer;
+
+import java.io.File;
+import java.security.KeyStore;
+
+/**
+ * @test
+ * @bug 8172975
+ * @summary SecurityTools.keytool() needs to accept user input
+ * @library /test/lib
+ */
+
+public class ImportPrompt {
+
+    private static final String COMMON =
+            "-storetype jks -storepass changeit -keypass changeit -debug";
+
+    public static void main(String[] args) throws Throwable {
+
+        kt("-keystore ks1 -genkeypair -alias a -dname CN=A");
+        kt("-keystore ks1 -exportcert -alias a -file a.cert");
+
+        // Just create a keystore
+        kt("-keystore ks2 -genkeypair -alias b -dname CN=B");
+
+        // no response text, assume no
+        kt("-keystore ks2 -importcert -alias a -file a.cert");
+        Asserts.assertFalse(hasA());
+
+        // no reply is no
+        SecurityTools.setResponse("no");
+        kt("-keystore ks2 -importcert -alias a -file a.cert");
+        Asserts.assertFalse(hasA());
+
+        // explicit yes
+        SecurityTools.setResponse("yes");
+        kt("-keystore ks2 -importcert -alias a -file a.cert");
+        Asserts.assertTrue(hasA());
+
+        // remove it
+        kt("-keystore ks2 -delete -alias a");
+        Asserts.assertFalse(hasA());
+
+        // the previous "yes" will not be remembered
+        kt("-keystore ks2 -importcert -alias a -file a.cert");
+        Asserts.assertFalse(hasA());
+
+        // add with -noprompt
+        SecurityTools.setResponse("");
+        kt("-keystore ks2 -importcert -alias a -file a.cert -noprompt");
+        Asserts.assertTrue(hasA());
+    }
+
+    private static OutputAnalyzer kt(String cmd) throws Throwable {
+        return SecurityTools.keytool(COMMON + " " + cmd)
+                .shouldHaveExitValue(0);
+    }
+
+    private static boolean hasA() throws Exception {
+        return KeyStore.getInstance(new File("ks2"), "changeit".toCharArray())
+                .containsAlias("a");
+    }
+}
--- a/jdk/test/sun/security/tools/keytool/ReadJar.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/ReadJar.java	Sat Jan 21 03:53:21 2017 +0000
@@ -57,16 +57,15 @@
         System.out.println(out.getOutput());
         out.shouldHaveExitValue(0);
 
-        out = SecurityTools.jarsigner("test_rsa.jar", "rsa_alias",
-                "-keystore keystore -storepass password ");
+        out = SecurityTools.jarsigner("-keystore keystore -storepass password "
+                + "test_rsa.jar rsa_alias");
         System.out.println(out.getOutput());
         out.shouldHaveExitValue(0);
 
         printCert("test_rsa.jar");
 
-        out = SecurityTools.jarsigner("test_md5.jar", "rsa_alias",
-                "-keystore keystore -storepass password "
-                        + "-sigalg MD5withRSA -digestalg MD5");
+        out = SecurityTools.jarsigner("-keystore keystore -storepass password "
+                + "-sigalg MD5withRSA -digestalg MD5 test_md5.jar rsa_alias");
         System.out.println(out.getOutput());
         out.shouldHaveExitValue(0);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/tools/jar/multiRelease/ApiValidatorTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary Tests for API validator.
+ * @library /test/lib /lib/testlibrary
+ * @modules java.base/jdk.internal.misc
+ *          jdk.compiler
+ *          jdk.jartool
+ * @build jdk.test.lib.JDKToolFinder jdk.test.lib.Utils jdk.test.lib.process.*
+ * @build jdk.testlibrary.FileUtils
+ * @build MRTestBase
+ * @run testng ApiValidatorTest
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.testlibrary.FileUtils;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.lang.reflect.Method;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public class ApiValidatorTest extends MRTestBase {
+
+    @Test(dataProvider = "signatureChange")
+    public void changeMethodSignature(String sigBase, String sigV10,
+                                      boolean isAcceptable,
+                                      Method method) throws Throwable {
+        Path root = Paths.get(method.getName());
+        Path classes = root.resolve("classes");
+
+        String METHOD_SIG = "#SIG";
+        String classTemplate =
+                "public class C { \n" +
+                        "    " + METHOD_SIG + "{ throw new RuntimeException(); };\n" +
+                        "}\n";
+        String base = classTemplate.replace(METHOD_SIG, sigBase);
+        String v10 = classTemplate.replace(METHOD_SIG, sigV10);
+
+        compileTemplate(classes.resolve("base"), base);
+        compileTemplate(classes.resolve("v10"), v10);
+
+        String jarfile = root.resolve("test.jar").toString();
+        OutputAnalyzer result = jar("cf", jarfile,
+                "-C", classes.resolve("base").toString(), ".",
+                "--release", "10", "-C", classes.resolve("v10").toString(),
+                ".");
+        if (isAcceptable) {
+            result.shouldHaveExitValue(SUCCESS)
+                    .shouldBeEmpty();
+        } else {
+            result.shouldNotHaveExitValue(SUCCESS)
+                    .shouldContain("contains a class with different api from earlier version");
+        }
+
+        FileUtils.deleteFileTreeWithRetry(root);
+    }
+
+    @DataProvider
+    Object[][] signatureChange() {
+        return new Object[][]{
+                {"public int m()", "protected int m()", false},
+                {"protected int m()", "public int m()", false},
+                {"public int m()", "int m()", false},
+                {"protected int m()", "private int m()", false},
+                {"private int m()", "int m()", true},
+                {"int m()", "private int m()", true},
+                {"int m()", "private int m(boolean b)", true},
+                {"public int m()", "public int m(int i)", false},
+                {"public int m()", "public int k()", false},
+                {"public int m()", "private int k()", false},
+// @ignore JDK-8172147   {"public int m()", "public boolean m()", false},
+// @ignore JDK-8172147   {"public boolean", "public Boolean", false},
+// @ignore JDK-8172147   {"public <T> T", "public <T extends String> T", false},
+        };
+    }
+
+    @Test(dataProvider = "publicAPI")
+    public void introducingPublicMembers(String publicAPI,
+                                         Method method) throws Throwable {
+        Path root = Paths.get(method.getName());
+        Path classes = root.resolve("classes");
+
+        String API = "#API";
+        String classTemplate =
+                "public class C { \n" +
+                        "    " + API + "\n" +
+                        "    public void method(){ };\n" +
+                        "}\n";
+        String base = classTemplate.replace(API, "");
+        String v10 = classTemplate.replace(API, publicAPI);
+
+        compileTemplate(classes.resolve("base"), base);
+        compileTemplate(classes.resolve("v10"), v10);
+
+        String jarfile = root.resolve("test.jar").toString();
+        jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
+                "--release", "10", "-C", classes.resolve("v10").toString(), ".")
+                .shouldNotHaveExitValue(SUCCESS)
+                .shouldContain("contains a class with different api from earlier version");
+
+        FileUtils.deleteFileTreeWithRetry(root);
+    }
+
+    @DataProvider
+    Object[][] publicAPI() {
+        return new Object[][]{
+// @ignore JDK-8172148  {"protected class Inner { public void m(){ } } "}, // protected inner class
+// @ignore JDK-8172148  {"public class Inner { public void m(){ } }"},  // public inner class
+// @ignore JDK-8172148  {"public enum E { A; }"},  // public enum
+                {"public void m(){ }"}, // public method
+                {"protected void m(){ }"}, // protected method
+        };
+    }
+
+    @Test(dataProvider = "privateAPI")
+    public void introducingPrivateMembers(String privateAPI,
+                                          Method method) throws Throwable {
+        Path root = Paths.get(method.getName());
+        Path classes = root.resolve("classes");
+
+        String API = "#API";
+        String classTemplate =
+                "public class C { \n" +
+                        "    " + API + "\n" +
+                        "    public void method(){ };\n" +
+                        "}\n";
+        String base = classTemplate.replace(API, "");
+        String v10 = classTemplate.replace(API, privateAPI);
+
+        compileTemplate(classes.resolve("base"), base);
+        compileTemplate(classes.resolve("v10"), v10);
+
+        String jarfile = root.resolve("test.jar").toString();
+        jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
+                "--release", "10", "-C", classes.resolve("v10").toString(), ".")
+                .shouldHaveExitValue(SUCCESS);
+        // add release
+        jar("uf", jarfile,
+                "--release", "11", "-C", classes.resolve("v10").toString(), ".")
+                .shouldHaveExitValue(SUCCESS);
+        // replace release
+        jar("uf", jarfile,
+                "--release", "11", "-C", classes.resolve("v10").toString(), ".")
+                .shouldHaveExitValue(SUCCESS);
+
+        FileUtils.deleteFileTreeWithRetry(root);
+    }
+
+    @DataProvider
+    Object[][] privateAPI() {
+        return new Object[][]{
+                {"private class Inner { public void m(){ } } "}, // private inner class
+                {"class Inner { public void m(){ } }"},  // package private inner class
+                {"enum E { A; }"},  // package private enum
+                // Local class and private method
+                {"private void m(){ class Inner { public void m(){} } Inner i = null; }"},
+                {"void m(){ }"}, // package private method
+        };
+    }
+
+    private void compileTemplate(Path classes, String template) throws Throwable {
+        Path classSourceFile = Files.createDirectories(
+                classes.getParent().resolve("src").resolve(classes.getFileName()))
+                .resolve("C.java");
+        Files.write(classSourceFile, template.getBytes());
+        javac(classes, classSourceFile);
+    }
+}
\ No newline at end of file
--- a/jdk/test/tools/jar/multiRelease/Basic.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jar/multiRelease/Basic.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,69 +23,59 @@
 
 /*
  * @test
- * @library /test/lib
+ * @library /test/lib /lib/testlibrary
  * @modules java.base/jdk.internal.misc
  *          jdk.compiler
  *          jdk.jartool
- * @build jdk.test.lib.JDKToolFinder jdk.test.lib.Utils
+ * @build jdk.test.lib.JDKToolFinder jdk.test.lib.Utils jdk.test.lib.process.*
+ * @build jdk.testlibrary.FileUtils
+ * @build MRTestBase
  * @run testng Basic
  */
 
 import static org.testng.Assert.*;
 
+import jdk.testlibrary.FileUtils;
 import org.testng.annotations.*;
 
-import java.io.*;
+import java.io.File;
 import java.nio.file.*;
-import java.nio.file.attribute.*;
 import java.util.*;
-import java.util.function.Consumer;
-import java.util.jar.*;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import java.util.zip.*;
+import java.util.jar.JarFile;
+import java.util.zip.ZipFile;
 
-import jdk.test.lib.JDKToolFinder;
-import jdk.test.lib.Utils;
-
-
-import static java.lang.String.format;
-import static java.lang.System.out;
-
-public class Basic {
-    private final String src = System.getProperty("test.src", ".");
-    private final String usr = System.getProperty("user.dir", ".");
+public class Basic extends MRTestBase {
 
     @Test
     // create a regular, non-multi-release jar
-    public void test00() throws IOException {
+    public void test00() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
 
         Path classes = Paths.get("classes");
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".")
-                .assertSuccess();
+                .shouldHaveExitValue(SUCCESS);
 
         checkMultiRelease(jarfile, false);
 
-        Map<String,String[]> names = Map.of(
+        Map<String, String[]> names = Map.of(
                 "version/Main.class",
-                new String[] {"base", "version", "Main.class"},
+                new String[]{"base", "version", "Main.class"},
 
                 "version/Version.class",
-                new String[] {"base", "version", "Version.class"}
+                new String[]{"base", "version", "Version.class"}
         );
 
         compare(jarfile, names);
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     @Test
     // create a multi-release jar
-    public void test01() throws IOException {
+    public void test01() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");
@@ -94,68 +84,96 @@
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".",
                 "--release", "10", "-C", classes.resolve("v10").toString(), ".")
-                .assertSuccess();
+                .shouldHaveExitValue(SUCCESS);
 
         checkMultiRelease(jarfile, true);
 
-        Map<String,String[]> names = Map.of(
+        Map<String, String[]> names = Map.of(
                 "version/Main.class",
-                new String[] {"base", "version", "Main.class"},
+                new String[]{"base", "version", "Main.class"},
 
                 "version/Version.class",
-                new String[] {"base", "version", "Version.class"},
+                new String[]{"base", "version", "Version.class"},
 
                 "META-INF/versions/9/version/Version.class",
-                new String[] {"v9", "version", "Version.class"},
+                new String[]{"v9", "version", "Version.class"},
 
                 "META-INF/versions/10/version/Version.class",
-                new String[] {"v10", "version", "Version.class"}
+                new String[]{"v10", "version", "Version.class"}
         );
 
         compare(jarfile, names);
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
+    }
+
+    @Test
+    public void versionFormat() throws Throwable {
+        String jarfile = "test.jar";
+
+        compile("test01");
+
+        Path classes = Paths.get("classes");
+
+        // valid
+        for (String release : List.of("10000", "09", "00010", "10")) {
+            jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
+                    "--release", release, "-C", classes.resolve("v10").toString(), ".")
+                    .shouldHaveExitValue(SUCCESS)
+                    .shouldBeEmpty();
+        }
+        // invalid
+        for (String release : List.of("9.0", "8", "v9",
+                "9v", "0", "-10")) {
+            jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
+                    "--release", release, "-C", classes.resolve("v10").toString(), ".")
+                    .shouldNotHaveExitValue(SUCCESS)
+                    .shouldContain("release " + release + " not valid");
+        }
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     @Test
     // update a regular jar to a multi-release jar
-    public void test02() throws IOException {
+    public void test02() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
 
         Path classes = Paths.get("classes");
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".")
-                .assertSuccess();
+                .shouldHaveExitValue(SUCCESS);
 
         checkMultiRelease(jarfile, false);
 
-        jar("uf", jarfile, "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertSuccess();
+        jar("uf", jarfile,
+                "--release", "9", "-C", classes.resolve("v9").toString(), ".")
+                .shouldHaveExitValue(SUCCESS);
 
         checkMultiRelease(jarfile, true);
 
-        Map<String,String[]> names = Map.of(
+        Map<String, String[]> names = Map.of(
                 "version/Main.class",
-                new String[] {"base", "version", "Main.class"},
+                new String[]{"base", "version", "Main.class"},
 
                 "version/Version.class",
-                new String[] {"base", "version", "Version.class"},
+                new String[]{"base", "version", "Version.class"},
 
                 "META-INF/versions/9/version/Version.class",
-                new String[] {"v9", "version", "Version.class"}
+                new String[]{"v9", "version", "Version.class"}
         );
 
         compare(jarfile, names);
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     @Test
     // replace a base entry and a versioned entry
-    public void test03() throws IOException {
+    public void test03() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
@@ -163,19 +181,19 @@
         Path classes = Paths.get("classes");
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertSuccess();
+                .shouldHaveExitValue(SUCCESS);
 
         checkMultiRelease(jarfile, true);
 
-        Map<String,String[]> names = Map.of(
+        Map<String, String[]> names = Map.of(
                 "version/Main.class",
-                new String[] {"base", "version", "Main.class"},
+                new String[]{"base", "version", "Main.class"},
 
                 "version/Version.class",
-                new String[] {"base", "version", "Version.class"},
+                new String[]{"base", "version", "Version.class"},
 
                 "META-INF/versions/9/version/Version.class",
-                new String[] {"v9", "version", "Version.class"}
+                new String[]{"v9", "version", "Version.class"}
         );
 
         compare(jarfile, names);
@@ -184,25 +202,25 @@
         // version/Version.class entry in versions/9 section
         jar("uf", jarfile, "-C", classes.resolve("v9").toString(), "version",
                 "--release", "9", "-C", classes.resolve("v10").toString(), ".")
-                .assertSuccess();
+                .shouldHaveExitValue(SUCCESS);
 
         checkMultiRelease(jarfile, true);
 
         names = Map.of(
                 "version/Main.class",
-                new String[] {"base", "version", "Main.class"},
+                new String[]{"base", "version", "Main.class"},
 
                 "version/Version.class",
-                new String[] {"v9", "version", "Version.class"},
+                new String[]{"v9", "version", "Version.class"},
 
                 "META-INF/versions/9/version/Version.class",
-                new String[] {"v10", "version", "Version.class"}
+                new String[]{"v10", "version", "Version.class"}
         );
 
         compare(jarfile, names);
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     /*
@@ -211,7 +229,7 @@
 
     @Test
     // META-INF/versions/9 class has different api than base class
-    public void test04() throws IOException {
+    public void test04() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
@@ -224,18 +242,16 @@
 
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertFailure()
-                .resultChecker(r ->
-                    assertTrue(r.output.contains("different api from earlier"), r.output)
-                );
+                .shouldNotHaveExitValue(SUCCESS)
+                .shouldContain("different api from earlier");
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     @Test
     // META-INF/versions/9 contains an extra public class
-    public void test05() throws IOException {
+    public void test05() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
@@ -248,18 +264,16 @@
 
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertFailure()
-                .resultChecker(r ->
-                        assertTrue(r.output.contains("contains a new public class"), r.output)
-                );
+                .shouldNotHaveExitValue(SUCCESS)
+                .shouldContain("contains a new public class");
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     @Test
     // META-INF/versions/9 contains an extra package private class -- this is okay
-    public void test06() throws IOException {
+    public void test06() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
@@ -272,16 +286,16 @@
 
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertSuccess();
+                .shouldHaveExitValue(SUCCESS);
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     @Test
     // META-INF/versions/9 contains an identical class to base entry class
     // this is okay but produces warning
-    public void test07() throws IOException {
+    public void test07() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
@@ -294,19 +308,42 @@
 
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertSuccess()
-                .resultChecker(r ->
-                        assertTrue(r.outputContains("contains a class that is identical"), r.output)
-                );
+                .shouldHaveExitValue(SUCCESS)
+                .shouldContain("contains a class that")
+                .shouldContain("is identical");
+
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
+    }
+
+    @Test
+    // META-INF/versions/9 contains an identical class to previous version entry class
+    // this is okay but produces warning
+    public void identicalClassToPreviousVersion() throws Throwable {
+        String jarfile = "test.jar";
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        compile("test01");  //use same data as test01
+
+        Path classes = Paths.get("classes");
+
+        jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
+                "--release", "9", "-C", classes.resolve("v9").toString(), ".")
+                .shouldHaveExitValue(SUCCESS)
+                .shouldBeEmpty();
+        jar("uf", jarfile,
+                "--release", "10", "-C", classes.resolve("v9").toString(), ".")
+                .shouldHaveExitValue(SUCCESS)
+                .shouldContain("contains a class that")
+                .shouldContain("is identical");
+
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     @Test
     // resources with same name in different versions
     // this is okay but produces warning
-    public void test08() throws IOException {
+    public void test08() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
@@ -320,10 +357,8 @@
 
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertSuccess()
-                .resultChecker(r ->
-                        assertTrue(r.output.isEmpty(), r.output)
-                );
+                .shouldHaveExitValue(SUCCESS)
+                .shouldBeEmpty();
 
         // now add a different resource with same name to META-INF/version/9
         Files.copy(source.resolve("Main.java"), classes.resolve("v9")
@@ -331,18 +366,16 @@
 
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertSuccess()
-                .resultChecker(r ->
-                        assertTrue(r.output.contains("multiple resources with same name"), r.output)
-                );
+                .shouldHaveExitValue(SUCCESS)
+                .shouldContain("multiple resources with same name");
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     @Test
     // a class with an internal name different from the external name
-    public void test09() throws IOException {
+    public void test09() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
@@ -355,18 +388,16 @@
 
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertFailure()
-                .resultChecker(r ->
-                        assertTrue(r.output.contains("names do not match"), r.output)
-                );
+                .shouldNotHaveExitValue(SUCCESS)
+                .shouldContain("names do not match");
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     @Test
     // assure that basic nested classes are acceptable
-    public void test10() throws IOException {
+    public void test10() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
@@ -383,15 +414,15 @@
 
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertSuccess();
+                .shouldHaveExitValue(SUCCESS);
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     @Test
     // a base entry contains a nested class that doesn't have a matching top level class
-    public void test11() throws IOException {
+    public void test11() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
@@ -409,30 +440,29 @@
         source = Paths.get(src, "data", "test10", "v9", "version");
         javac(classes.resolve("v9"), source.resolve("Nested.java"));
 
-        jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
+        List<String> output = jar("cf", jarfile,
+                "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertFailure()
-                .resultChecker(r -> {
-                    String[] msg = r.output.split("\\R");
-                    // There should be 3 error messages, cascading from the first.  Once we
-                    // remove the base top level class, the base nested class becomes isolated,
-                    // also the versioned top level class becomes a new public class, thus ignored
-                    // for subsequent checks, leading to the associated versioned nested class
-                    // becoming an isolated nested class
-                    assertTrue(msg.length == 4);
-                    assertTrue(msg[0].contains("an isolated nested class"), msg[0]);
-                    assertTrue(msg[1].contains("contains a new public class"), msg[1]);
-                    assertTrue(msg[2].contains("an isolated nested class"), msg[2]);
-                    assertTrue(msg[3].contains("invalid multi-release jar file"), msg[3]);
-                });
+                .shouldNotHaveExitValue(SUCCESS)
+                .asLines();
 
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
+        assertTrue(output.size() == 4);
+        assertTrue(output.get(0).contains("an isolated nested class"),
+                output.get(0));
+        assertTrue(output.get(1).contains("contains a new public class"),
+                output.get(1));
+        assertTrue(output.get(2).contains("an isolated nested class"),
+                output.get(2));
+        assertTrue(output.get(3).contains("invalid multi-release jar file"),
+                output.get(3));
+
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
     @Test
     // a versioned entry contains a nested class that doesn't have a matching top level class
-    public void test12() throws IOException {
+    public void test12() throws Throwable {
         String jarfile = "test.jar";
 
         compile("test01");  //use same data as test01
@@ -452,178 +482,59 @@
 
         jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
                 "--release", "9", "-C", classes.resolve("v9").toString(), ".")
-                .assertFailure()
-                .resultChecker(r ->
-                        assertTrue(r.outputContains("an isolated nested class"), r.output)
-                );
-
-        delete(jarfile);
-        deleteDir(Paths.get(usr, "classes"));
-    }
-
-    /*
-     *  Test Infrastructure
-     */
-    private void compile(String test) throws IOException {
-        Path classes = Paths.get(usr, "classes", "base");
-        Files.createDirectories(classes);
-        Path source = Paths.get(src, "data", test, "base", "version");
-        javac(classes, source.resolve("Main.java"), source.resolve("Version.java"));
-
-        classes = Paths.get(usr, "classes", "v9");
-        Files.createDirectories(classes);
-        source = Paths.get(src, "data", test, "v9", "version");
-        javac(classes, source.resolve("Version.java"));
-
-        classes = Paths.get(usr, "classes", "v10");
-        Files.createDirectories(classes);
-        source = Paths.get(src, "data", test, "v10", "version");
-        javac(classes, source.resolve("Version.java"));
-    }
-
-    private void checkMultiRelease(String jarFile, boolean expected) throws IOException {
-        try (JarFile jf = new JarFile(new File(jarFile), true, ZipFile.OPEN_READ,
-                JarFile.runtimeVersion())) {
-            assertEquals(jf.isMultiRelease(), expected);
-        }
-    }
+                .shouldNotHaveExitValue(SUCCESS)
+                .shouldContain("an isolated nested class");
 
-    // compares the bytes found in the jar entries with the bytes found in the
-    // corresponding data files used to create the entries
-    private void compare(String jarfile, Map<String,String[]> names) throws IOException {
-        try (JarFile jf = new JarFile(jarfile)) {
-            for (String name : names.keySet()) {
-                Path path = Paths.get("classes", names.get(name));
-                byte[] b1 = Files.readAllBytes(path);
-                byte[] b2;
-                JarEntry je = jf.getJarEntry(name);
-                try (InputStream is = jf.getInputStream(je)) {
-                    b2 = is.readAllBytes();
-                }
-                assertEquals(b1,b2);
-            }
-        }
-    }
-
-    private void delete(String name) throws IOException {
-        Files.deleteIfExists(Paths.get(usr, name));
-    }
-
-    private void deleteDir(Path dir) throws IOException {
-        Files.walkFileTree(dir, new SimpleFileVisitor<Path>() {
-            @Override
-            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
-                Files.delete(file);
-                return FileVisitResult.CONTINUE;
-            }
-
-            @Override
-            public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
-                Files.delete(dir);
-                return FileVisitResult.CONTINUE;
-            }
-        });
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 
-    /*
-     * The following methods were taken from modular jar and other jar tests
-     */
+    @Test
+    public void testCustomManifest() throws Throwable {
+        String jarfile = "test.jar";
 
-    void javac(Path dest, Path... sourceFiles) throws IOException {
-        String javac = JDKToolFinder.getJDKTool("javac");
+        compile("test01");
 
-        List<String> commands = new ArrayList<>();
-        commands.add(javac);
-        String opts = System.getProperty("test.compiler.opts");
-        if (!opts.isEmpty()) {
-            commands.addAll(Arrays.asList(opts.split(" +")));
-        }
-        commands.add("-d");
-        commands.add(dest.toString());
-        Stream.of(sourceFiles).map(Object::toString).forEach(x -> commands.add(x));
+        Path classes = Paths.get("classes");
+        Path manifest = Paths.get("Manifest.txt");
 
-        quickFail(run(new ProcessBuilder(commands)));
-    }
+        // create
+        Files.write(manifest, "Class-Path: MyUtils.jar\n".getBytes());
 
-    Result jarWithStdin(File stdinSource, String... args) {
-        String jar = JDKToolFinder.getJDKTool("jar");
-        List<String> commands = new ArrayList<>();
-        commands.add(jar);
-        commands.addAll(Utils.getForwardVmOptions());
-        Stream.of(args).forEach(x -> commands.add(x));
-        ProcessBuilder p = new ProcessBuilder(commands);
-        if (stdinSource != null)
-            p.redirectInput(stdinSource);
-        return run(p);
-    }
+        jar("cfm", jarfile, manifest.toString(),
+                "-C", classes.resolve("base").toString(), ".",
+                "--release", "10", "-C", classes.resolve("v10").toString(), ".")
+                .shouldHaveExitValue(SUCCESS)
+                .shouldBeEmpty();
 
-    Result jar(String... args) {
-        return jarWithStdin(null, args);
-    }
-
-    void quickFail(Result r) {
-        if (r.ec != 0)
-            throw new RuntimeException(r.output);
-    }
-
-    Result run(ProcessBuilder pb) {
-        Process p;
-        out.printf("Running: %s%n", pb.command());
-        try {
-            p = pb.start();
-        } catch (IOException e) {
-            throw new RuntimeException(
-                    format("Couldn't start process '%s'", pb.command()), e);
+        try (JarFile jf = new JarFile(new File(jarfile), true,
+                ZipFile.OPEN_READ, JarFile.runtimeVersion())) {
+            assertTrue(jf.isMultiRelease(), "Not multi-release jar");
+            assertEquals(jf.getManifest()
+                            .getMainAttributes()
+                            .getValue("Class-Path"),
+                    "MyUtils.jar");
         }
 
-        String output;
-        try {
-            output = toString(p.getInputStream(), p.getErrorStream());
-        } catch (IOException e) {
-            throw new RuntimeException(
-                    format("Couldn't read process output '%s'", pb.command()), e);
+        // update
+        Files.write(manifest, "Multi-release: false\n".getBytes());
+
+        jar("ufm", jarfile, manifest.toString(),
+                "-C", classes.resolve("base").toString(), ".",
+                "--release", "9", "-C", classes.resolve("v10").toString(), ".")
+                .shouldHaveExitValue(SUCCESS)
+                .shouldContain("WARNING: Duplicate name in Manifest: Multi-release.");
+
+        try (JarFile jf = new JarFile(new File(jarfile), true,
+                ZipFile.OPEN_READ, JarFile.runtimeVersion())) {
+            assertTrue(jf.isMultiRelease(), "Not multi-release jar");
+            assertEquals(jf.getManifest()
+                            .getMainAttributes()
+                            .getValue("Class-Path"),
+                    "MyUtils.jar");
         }
 
-        try {
-            p.waitFor();
-        } catch (InterruptedException e) {
-            throw new RuntimeException(
-                    format("Process hasn't finished '%s'", pb.command()), e);
-        }
-        return new Result(p.exitValue(), output);
-    }
-
-    String toString(InputStream in1, InputStream in2) throws IOException {
-        try (ByteArrayOutputStream dst = new ByteArrayOutputStream();
-             InputStream concatenated = new SequenceInputStream(in1, in2)) {
-            concatenated.transferTo(dst);
-            return new String(dst.toByteArray(), "UTF-8");
-        }
-    }
-
-    static class Result {
-        final int ec;
-        final String output;
-
-        private Result(int ec, String output) {
-            this.ec = ec;
-            this.output = output;
-        }
-
-        boolean outputContains(String msg) {
-            return Arrays.stream(output.split("\\R"))
-                         .collect(Collectors.joining(" "))
-                         .contains(msg);
-        }
-
-        Result assertSuccess() {
-            assertTrue(ec == 0, format("ec: %d, output: %s", ec, output));
-            return this;
-        }
-        Result assertFailure() {
-            assertTrue(ec != 0, format("ec: %d, output: %s", ec, output));
-            return this;
-        }
-        Result resultChecker(Consumer<Result> r) { r.accept(this); return this; }
+        FileUtils.deleteFileIfExistsWithRetry(Paths.get(jarfile));
+        FileUtils.deleteFileTreeWithRetry(Paths.get(usr, "classes"));
     }
 }
--- a/jdk/test/tools/jar/multiRelease/Basic1.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jar/multiRelease/Basic1.java	Sat Jan 21 03:53:21 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,76 +28,65 @@
  *          jdk.compiler
  *          jdk.jartool
  * @build jdk.test.lib.JDKToolFinder jdk.test.lib.Utils
+ * @build MRTestBase
  * @run testng Basic1
  */
 
-import static org.testng.Assert.*;
-
 import org.testng.annotations.*;
 
-import java.io.*;
 import java.nio.file.*;
 import java.util.*;
-import java.util.function.Consumer;
-import java.util.jar.*;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import java.util.zip.*;
 
-import jdk.test.lib.JDKToolFinder;
-import jdk.test.lib.Utils;
-
-
-import static java.lang.String.format;
-import static java.lang.System.out;
-
-public class Basic1 {
-    private final String src = System.getProperty("test.src", ".");
+public class Basic1 extends MRTestBase {
 
     @BeforeTest
-    public void setup() throws IOException {
+    public void setup() throws Throwable {
         String test = "test01";
-        Path classes = Paths.get("classes", "base");
-        Files.createDirectories(classes);
+        Path classes = Paths.get("classes");
+
+        Path base = classes.resolve("base");
+        Files.createDirectories(base);
         Path source = Paths.get(src, "data", test, "base", "version");
-        javac(classes, source.resolve("Main.java"), source.resolve("Version.java"));
+        javac(base, source.resolve("Main.java"), source.resolve("Version.java"));
 
-        Path v9 = Paths.get("v9");
+        Path v9 = classes.resolve("v9");
         Files.createDirectories(v9);
         source = Paths.get(src, "data", test, "v9", "version");
         javac(v9, source.resolve("Version.java"));
 
-        Path v10 = Paths.get("v10");
+        Path v10 = classes.resolve("v10");
         Files.createDirectories(v10);
         source = Paths.get(src, "data", test, "v10", "version");
         javac(v10, source.resolve("Version.java"));
 
-        Path v10_1 = Paths.get("v10_1").resolve("META-INF").resolve("versions").resolve("v10");
+        Path v10_1 = classes.resolve("v10_1").resolve("META-INF").resolve("versions").resolve("v10");
         Files.createDirectories(v10_1);
         source = Paths.get(src, "data", test, "v10", "version");
         javac(v10_1, source.resolve("Version.java"));
     }
 
     @Test
-    public void test() throws IOException {
+    public void test() throws Throwable {
         String jarfile = "test.jar";
         Path classes = Paths.get("classes");
-        Path v9 = Paths.get("v9");
-        Path v10 = Paths.get("v10");
+
+        Path base = classes.resolve("base");
+        Path v9 = classes.resolve("v9");
+        Path v10 = classes.resolve("v10");
 
-        jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
-            "--release", "9", "-C", v9.toString(), ".",
-            "--release", "10", "-C", v10.toString(), ".")
-            .assertSuccess();
+        jar("cf", jarfile, "-C", base.toString(), ".",
+                "--release", "9", "-C", v9.toString(), ".",
+                "--release", "10", "-C", v10.toString(), ".")
+                .shouldHaveExitValue(SUCCESS);
 
         checkMultiRelease(jarfile, true);
 
-        Map<String,String[]> names = Map.of(
-            "version/Main.class",
-            new String[] {"classes", "base", "version", "Main.class"},
+        Map<String, String[]> names = Map.of(
+                "version/Main.class",
+                new String[]{"base", "version", "Main.class"},
 
-            "version/Version.class",
-            new String[] {"classes", "base", "version", "Version.class"},
+                "version/Version.class",
+                new String[]{"base", "version", "Version.class"},
 
             "META-INF/versions/9/version/Version.class",
             new String[] {"v9", "version", "Version.class"},
@@ -109,144 +98,16 @@
         compare(jarfile, names);
     }
 
-
     @Test
-    public void testFail() throws IOException {
+    public void testFail() throws Throwable {
         String jarfile = "test.jar";
         Path classes = Paths.get("classes");
-        Path v10 = Paths.get("v10_1");
-
-        jar("cf", jarfile, "-C", classes.resolve("base").toString(), ".",
-            "--release", "10", "-C", v10.toString(), ".")
-            .assertFailure()
-            .outputContains("unexpected versioned entry META-INF/versions/");
-    }
-
-
-
-    private void checkMultiRelease(String jarFile, boolean expected) throws IOException {
-        try (JarFile jf = new JarFile(new File(jarFile), true, ZipFile.OPEN_READ,
-                JarFile.runtimeVersion())) {
-            assertEquals(jf.isMultiRelease(), expected);
-        }
-    }
-
-    // compares the bytes found in the jar entries with the bytes found in the
-    // corresponding data files used to create the entries
-    private void compare(String jarfile, Map<String,String[]> names) throws IOException {
-        try (JarFile jf = new JarFile(jarfile)) {
-            for (String name : names.keySet()) {
-                Path path = Paths.get("", names.get(name));
-                byte[] b1 = Files.readAllBytes(path);
-                byte[] b2;
-                JarEntry je = jf.getJarEntry(name);
-                try (InputStream is = jf.getInputStream(je)) {
-                    b2 = is.readAllBytes();
-                }
-                assertEquals(b1,b2);
-            }
-        }
-    }
-
-    /*
-     * The following methods were taken from modular jar and other jar tests
-     */
-
-    void javac(Path dest, Path... sourceFiles) throws IOException {
-        String javac = JDKToolFinder.getJDKTool("javac");
-
-        List<String> commands = new ArrayList<>();
-        commands.add(javac);
-        String opts = System.getProperty("test.compiler.opts");
-        if (!opts.isEmpty()) {
-            commands.addAll(Arrays.asList(opts.split(" +")));
-        }
-        commands.add("-d");
-        commands.add(dest.toString());
-        Stream.of(sourceFiles).map(Object::toString).forEach(x -> commands.add(x));
-
-        quickFail(run(new ProcessBuilder(commands)));
-    }
-
-    Result jarWithStdin(File stdinSource, String... args) {
-        String jar = JDKToolFinder.getJDKTool("jar");
-        List<String> commands = new ArrayList<>();
-        commands.add(jar);
-        commands.addAll(Utils.getForwardVmOptions());
-        Stream.of(args).forEach(x -> commands.add(x));
-        ProcessBuilder p = new ProcessBuilder(commands);
-        if (stdinSource != null)
-            p.redirectInput(stdinSource);
-        return run(p);
-    }
+        Path base = classes.resolve("base");
+        Path v10 = classes.resolve("v10_1");
 
-    Result jar(String... args) {
-        return jarWithStdin(null, args);
-    }
-
-    void quickFail(Result r) {
-        if (r.ec != 0)
-            throw new RuntimeException(r.output);
-    }
-
-    Result run(ProcessBuilder pb) {
-        Process p;
-        out.printf("Running: %s%n", pb.command());
-        try {
-            p = pb.start();
-        } catch (IOException e) {
-            throw new RuntimeException(
-                    format("Couldn't start process '%s'", pb.command()), e);
-        }
-
-        String output;
-        try {
-            output = toString(p.getInputStream(), p.getErrorStream());
-        } catch (IOException e) {
-            throw new RuntimeException(
-                    format("Couldn't read process output '%s'", pb.command()), e);
-        }
-
-        try {
-            p.waitFor();
-        } catch (InterruptedException e) {
-            throw new RuntimeException(
-                    format("Process hasn't finished '%s'", pb.command()), e);
-        }
-        return new Result(p.exitValue(), output);
-    }
-
-    String toString(InputStream in1, InputStream in2) throws IOException {
-        try (ByteArrayOutputStream dst = new ByteArrayOutputStream();
-             InputStream concatenated = new SequenceInputStream(in1, in2)) {
-            concatenated.transferTo(dst);
-            return new String(dst.toByteArray(), "UTF-8");
-        }
-    }
-
-    static class Result {
-        final int ec;
-        final String output;
-
-        private Result(int ec, String output) {
-            this.ec = ec;
-            this.output = output;
-        }
-
-        boolean outputContains(String msg) {
-            return Arrays.stream(output.split("\\R"))
-                         .collect(Collectors.joining(" "))
-                         .contains(msg);
-        }
-
-        Result assertSuccess() {
-            assertTrue(ec == 0, format("ec: %d, output: %s", ec, output));
-            return this;
-        }
-        Result assertFailure() {
-            assertTrue(ec != 0, format("ec: %d, output: %s", ec, output));
-            return this;
-        }
-        Result resultChecker(Consumer<Result> r) { r.accept(this); return this; }
+        jar("cf", jarfile, "-C", base.toString(), ".",
+                "--release", "10", "-C", v10.toString(), ".")
+                .shouldNotHaveExitValue(SUCCESS)
+                .shouldContain("unexpected versioned entry META-INF/versions/");
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/tools/jar/multiRelease/MRTestBase.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.Utils;
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+
+import java.io.*;
+import java.nio.file.*;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.stream.Stream;
+import java.util.zip.ZipFile;
+
+import static org.testng.Assert.assertEquals;
+
+public class MRTestBase {
+
+    public static final int SUCCESS = 0;
+
+    protected final String src = System.getProperty("test.src", ".");
+    protected final String usr = System.getProperty("user.dir", ".");
+
+    protected void compile(String test) throws Throwable {
+        Path classes = Paths.get(usr, "classes", "base");
+        Files.createDirectories(classes);
+        Path source = Paths.get(src, "data", test, "base", "version");
+        javac(classes, source.resolve("Main.java"), source.resolve("Version.java"));
+
+        classes = Paths.get(usr, "classes", "v9");
+        Files.createDirectories(classes);
+        source = Paths.get(src, "data", test, "v9", "version");
+        javac(classes, source.resolve("Version.java"));
+
+        classes = Paths.get(usr, "classes", "v10");
+        Files.createDirectories(classes);
+        source = Paths.get(src, "data", test, "v10", "version");
+        javac(classes, source.resolve("Version.java"));
+    }
+
+    protected void checkMultiRelease(String jarFile,
+                                     boolean expected) throws IOException {
+        try (JarFile jf = new JarFile(new File(jarFile), true,
+                ZipFile.OPEN_READ, JarFile.runtimeVersion())) {
+            assertEquals(jf.isMultiRelease(), expected);
+        }
+    }
+
+    // compares the bytes found in the jar entries with the bytes found in the
+    // corresponding data files used to create the entries
+    protected void compare(String jarfile,
+                           Map<String, String[]> names) throws IOException {
+        try (JarFile jf = new JarFile(jarfile)) {
+            for (String name : names.keySet()) {
+                Path path = Paths.get("classes", names.get(name));
+                byte[] b1 = Files.readAllBytes(path);
+                byte[] b2;
+                JarEntry je = jf.getJarEntry(name);
+                try (InputStream is = jf.getInputStream(je)) {
+                    b2 = is.readAllBytes();
+                }
+                assertEquals(b1, b2);
+            }
+        }
+    }
+
+    void javac(Path dest, Path... sourceFiles) throws Throwable {
+        String javac = JDKToolFinder.getJDKTool("javac");
+
+        List<String> commands = new ArrayList<>();
+        commands.add(javac);
+        String opts = System.getProperty("test.compiler.opts");
+        if (!opts.isEmpty()) {
+            commands.addAll(Arrays.asList(opts.split(" +")));
+        }
+        commands.addAll(Utils.getForwardVmOptions());
+        commands.add("-d");
+        commands.add(dest.toString());
+        Stream.of(sourceFiles)
+                .map(Object::toString)
+                .forEach(x -> commands.add(x));
+
+        ProcessTools.executeCommand(new ProcessBuilder(commands))
+                .shouldHaveExitValue(SUCCESS);
+    }
+
+    OutputAnalyzer jarWithStdin(File stdinSource,
+                                String... args) throws Throwable {
+
+        String jar = JDKToolFinder.getJDKTool("jar");
+        List<String> commands = new ArrayList<>();
+        commands.add(jar);
+        commands.addAll(Utils.getForwardVmOptions());
+        Stream.of(args).forEach(x -> commands.add(x));
+        ProcessBuilder p = new ProcessBuilder(commands);
+        if (stdinSource != null)
+            p.redirectInput(stdinSource);
+        return ProcessTools.executeCommand(p);
+    }
+
+    OutputAnalyzer jar(String... args) throws Throwable {
+        return jarWithStdin(null, args);
+    }
+}
\ No newline at end of file
--- a/jdk/test/tools/jar/multiRelease/data/test04/v9/version/Version.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jar/multiRelease/data/test04/v9/version/Version.java	Sat Jan 21 03:53:21 2017 +0000
@@ -8,7 +8,7 @@
     protected void doNothing() {
     }
 
-    // extra publc method
+    // extra public method
     public void anyName() {
     }
 }
--- a/jdk/test/tools/jlink/DefaultProviderTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/DefaultProviderTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -44,6 +44,7 @@
  * @modules java.base/jdk.internal.jimage
  *          jdk.jdeps/com.sun.tools.classfile
  *          jdk.jlink/jdk.tools.jlink.internal
+ *          jdk.jlink/jdk.tools.jlink.plugin
  *          jdk.jlink/jdk.tools.jmod
  *          jdk.jlink/jdk.tools.jimage
  *          jdk.compiler
--- a/jdk/test/tools/jlink/ImageFileCreatorTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/ImageFileCreatorTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -48,6 +48,7 @@
  * @author Jean-Francois Denise
  * @modules jdk.jlink/jdk.tools.jlink.internal
  *          jdk.jlink/jdk.tools.jlink.builder
+ *          jdk.jlink/jdk.tools.jlink.plugin
  *          java.base/jdk.internal.jimage
  * @run main/othervm -verbose:gc -Xmx1g ImageFileCreatorTest
  */
--- a/jdk/test/tools/jlink/ImageFilePoolTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/ImageFilePoolTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -26,6 +26,7 @@
  * @summary Test a pool containing external files.
  * @author Andrei Eremeev
  * @modules jdk.jlink/jdk.tools.jlink.internal
+ *          jdk.jlink/jdk.tools.jlink.plugin
  * @run build ImageFilePoolTest
  * @run main ImageFilePoolTest
  */
--- a/jdk/test/tools/jlink/IntegrationTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/IntegrationTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -62,6 +62,7 @@
  *          jdk.jlink/jdk.tools.jlink.builder
  *          jdk.jlink/jdk.tools.jlink.internal
  *          jdk.jlink/jdk.tools.jlink.internal.plugins
+ *          jdk.jlink/jdk.tools.jlink.plugin
  *          jdk.jlink/jdk.tools.jmod
  *          jdk.jlink/jdk.tools.jimage
  *          jdk.compiler
--- a/jdk/test/tools/jlink/JLink2Test.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/JLink2Test.java	Sat Jan 21 03:53:21 2017 +0000
@@ -29,6 +29,7 @@
  * @modules java.base/jdk.internal.jimage
  *          jdk.jdeps/com.sun.tools.classfile
  *          jdk.jlink/jdk.tools.jlink.internal
+ *          jdk.jlink/jdk.tools.jlink.plugin
  *          jdk.jlink/jdk.tools.jmod
  *          jdk.jlink/jdk.tools.jimage
  *          jdk.compiler
--- a/jdk/test/tools/jlink/JLinkOptionsTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/JLinkOptionsTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -39,6 +39,7 @@
  * @modules java.base/jdk.internal.jimage
  *          jdk.jdeps/com.sun.tools.classfile
  *          jdk.jlink/jdk.tools.jlink.internal
+ *          jdk.jlink/jdk.tools.jlink.plugin
  *          jdk.jlink/jdk.tools.jmod
  *          jdk.jlink/jdk.tools.jimage
  *          jdk.compiler
--- a/jdk/test/tools/jlink/JLinkPostProcessingTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/JLinkPostProcessingTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -46,6 +46,7 @@
  * @modules java.base/jdk.internal.jimage
  *          jdk.jdeps/com.sun.tools.classfile
  *          jdk.jlink/jdk.tools.jlink.internal
+ *          jdk.jlink/jdk.tools.jlink.plugin
  *          jdk.jlink/jdk.tools.jmod
  *          jdk.jlink/jdk.tools.jimage
  *          jdk.compiler
--- a/jdk/test/tools/jlink/JLinkTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/JLinkTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -48,6 +48,7 @@
  * @modules java.base/jdk.internal.jimage
  *          jdk.jdeps/com.sun.tools.classfile
  *          jdk.jlink/jdk.tools.jlink.internal
+ *          jdk.jlink/jdk.tools.jlink.plugin
  *          jdk.jlink/jdk.tools.jimage
  *          jdk.compiler
  * @build tests.*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/tools/jlink/ResourceDuplicateCheckTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8168254
+ * @summary Detect duplicated resources in packaged modules
+ * @modules jdk.jlink/jdk.tools.jlink.builder
+ *          jdk.jlink/jdk.tools.jlink.internal
+ *          jdk.jlink/jdk.tools.jlink.plugin
+ * @run build ResourceDuplicateCheckTest
+ * @run main ResourceDuplicateCheckTest
+ */
+
+import java.net.URI;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Collections;
+import jdk.tools.jlink.builder.DefaultImageBuilder;
+import jdk.tools.jlink.internal.ResourcePoolEntryFactory;
+import jdk.tools.jlink.internal.ResourcePoolManager;
+import jdk.tools.jlink.plugin.PluginException;
+import jdk.tools.jlink.plugin.ResourcePoolEntry;
+
+public class ResourceDuplicateCheckTest {
+    public static void main(String[] args) throws Exception {
+        new ResourceDuplicateCheckTest().test();
+    }
+
+    public void test() throws Exception {
+        ResourcePoolManager input = new ResourcePoolManager();
+        // need java.base module info because OS name is retrieved from it from storeFiles
+        input.add(ResourcePoolEntryFactory.create("/java.base/module-info.class",
+                    ResourcePoolEntry.Type.CLASS_OR_RESOURCE, getJavaBaseModuleInfo()));
+
+        // same NATIVE_CMD from two different modules
+        input.add(newInMemoryImageFile("/com.acme/bin/myexec",
+                    ResourcePoolEntry.Type.NATIVE_CMD, "mylib"));
+        input.add(newInMemoryImageFile("/com.foo/bin/myexec",
+                    ResourcePoolEntry.Type.NATIVE_CMD, "mylib"));
+        Path root = Paths.get(System.getProperty("test.classes"));
+        DefaultImageBuilder writer = new DefaultImageBuilder(root, Collections.emptyMap());
+        try {
+            writer.storeFiles(input.resourcePool());
+        } catch (PluginException pe) {
+            if (! pe.getMessage().contains("Duplicate resources:")) {
+                throw new AssertionError("expected duplicate resources message");
+            }
+        }
+    }
+
+    private byte[] getJavaBaseModuleInfo() throws Exception {
+        Path path = FileSystems.
+                getFileSystem(URI.create("jrt:/")).
+                getPath("/modules/java.base/module-info.class");
+        return Files.readAllBytes(path);
+    }
+
+    private static ResourcePoolEntry newInMemoryImageFile(String path,
+            ResourcePoolEntry.Type type, String content) {
+        return ResourcePoolEntryFactory.create(path, type, content.getBytes());
+    }
+}
--- a/jdk/test/tools/jlink/ResourcePoolTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/ResourcePoolTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -26,6 +26,7 @@
  * @summary Test a pool containing jimage resources and classes.
  * @author Jean-Francois Denise
  * @modules jdk.jlink/jdk.tools.jlink.internal
+ *          jdk.jlink/jdk.tools.jlink.plugin
  * @run build ResourcePoolTest
  * @run main ResourcePoolTest
  */
--- a/jdk/test/tools/jlink/plugins/CompressorPluginTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/CompressorPluginTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -28,6 +28,7 @@
  * @modules java.base/jdk.internal.jimage.decompressor
  *          jdk.jlink/jdk.tools.jlink.internal
  *          jdk.jlink/jdk.tools.jlink.internal.plugins
+ *          jdk.jlink/jdk.tools.jlink.plugin
  * @run main CompressorPluginTest
  */
 import java.net.URI;
--- a/jdk/test/tools/jlink/plugins/ExcludeFilesPluginTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/ExcludeFilesPluginTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -27,6 +27,7 @@
  * @author Jean-Francois Denise
  * @modules jdk.jlink/jdk.tools.jlink.internal
  *          jdk.jlink/jdk.tools.jlink.internal.plugins
+ *          jdk.jlink/jdk.tools.jlink.plugin
  * @run main ExcludeFilesPluginTest
  */
 
--- a/jdk/test/tools/jlink/plugins/ExcludePluginTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/ExcludePluginTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -27,6 +27,7 @@
  * @author Jean-Francois Denise
  * @modules jdk.jlink/jdk.tools.jlink.internal
  *          jdk.jlink/jdk.tools.jlink.internal.plugins
+ *          jdk.jlink/jdk.tools.jlink.plugin
  * @run main ExcludePluginTest
  */
 
--- a/jdk/test/tools/jlink/plugins/ExcludeVMPluginTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/ExcludeVMPluginTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -27,6 +27,7 @@
  * @author Jean-Francois Denise
  * @modules jdk.jlink/jdk.tools.jlink.internal
  *          jdk.jlink/jdk.tools.jlink.internal.plugins
+ *          jdk.jlink/jdk.tools.jlink.plugin
  * @run main ExcludeVMPluginTest
  */
 import java.io.ByteArrayInputStream;
--- a/jdk/test/tools/jlink/plugins/IncludeLocalesPluginTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/IncludeLocalesPluginTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -48,6 +48,7 @@
  *          jdk.jdeps/com.sun.tools.classfile
  *          jdk.jlink/jdk.tools.jlink.internal
  *          jdk.jlink/jdk.tools.jlink.internal.plugins
+ *          jdk.jlink/jdk.tools.jlink.plugin
  *          jdk.jlink/jdk.tools.jmod
  *          jdk.jlink/jdk.tools.jimage
  *          jdk.compiler
--- a/jdk/test/tools/jlink/plugins/LastSorterTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/LastSorterTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -25,8 +25,9 @@
  * @test
  * @summary Test last sorter property
  * @author Jean-Francois Denise
- * @modules jdk.jlink/jdk.tools.jlink.internal
- *          jdk.jlink/jdk.tools.jlink
+ * @modules jdk.jlink/jdk.tools.jlink
+ *          jdk.jlink/jdk.tools.jlink.internal
+ *          jdk.jlink/jdk.tools.jlink.plugin
  * @run main/othervm LastSorterTest
  */
 
--- a/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -25,8 +25,9 @@
  * @test
  * @summary Negative test for ImagePluginStack.
  * @author Andrei Eremeev
- * @modules jdk.jlink/jdk.tools.jlink.internal
- *          jdk.jlink/jdk.tools.jlink
+ * @modules jdk.jlink/jdk.tools.jlink
+ *          jdk.jlink/jdk.tools.jlink.internal
+ *          jdk.jlink/jdk.tools.jlink.plugin
  * @run main/othervm PluginsNegativeTest
  */
 import java.lang.reflect.Layer;
--- a/jdk/test/tools/jlink/plugins/PrevisitorTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/PrevisitorTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -25,8 +25,9 @@
  * @test
  * @summary Test previsitor
  * @author Andrei Eremeev
- * @modules jdk.jlink/jdk.tools.jlink.internal
- *          jdk.jlink/jdk.tools.jlink
+ * @modules jdk.jlink/jdk.tools.jlink
+ *          jdk.jlink/jdk.tools.jlink.internal
+ *          jdk.jlink/jdk.tools.jlink.plugin
  * @run main/othervm PrevisitorTest
  */
 import java.nio.ByteOrder;
--- a/jdk/test/tools/jlink/plugins/StringSharingPluginTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/StringSharingPluginTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -30,6 +30,7 @@
  *          java.base/jdk.internal.jimage.decompressor
  *          jdk.jlink/jdk.tools.jlink.internal
  *          jdk.jlink/jdk.tools.jlink.internal.plugins
+ *          jdk.jlink/jdk.tools.jlink.plugin
  *          jdk.jlink/jdk.tools.jmod
  *          jdk.jlink/jdk.tools.jimage
  *          jdk.jdeps/com.sun.tools.classfile
--- a/jdk/test/tools/jlink/plugins/StripDebugPluginTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jlink/plugins/StripDebugPluginTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -30,6 +30,7 @@
  * @modules java.base/jdk.internal.jimage
  *          jdk.jlink/jdk.tools.jlink.internal
  *          jdk.jlink/jdk.tools.jlink.internal.plugins
+ *          jdk.jlink/jdk.tools.jlink.plugin
  *          jdk.jlink/jdk.tools.jimage
  *          jdk.jlink/jdk.tools.jmod
  *          jdk.jdeps/com.sun.tools.classfile
--- a/jdk/test/tools/jmod/JmodTest.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/jmod/JmodTest.java	Sat Jan 21 03:53:21 2017 +0000
@@ -29,7 +29,7 @@
  * @modules jdk.compiler
  *          jdk.jlink
  * @build jdk.testlibrary.FileUtils CompilerUtils
- * @run testng JmodTest
+ * @run testng/othervm -Djava.io.tmpdir=. JmodTest
  */
 
 import java.io.*;
@@ -40,8 +40,10 @@
 import java.util.function.Consumer;
 import java.util.regex.Pattern;
 import java.util.spi.ToolProvider;
+import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import jdk.testlibrary.FileUtils;
+import jdk.testlibrary.JDKToolFinder;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 
@@ -593,9 +595,7 @@
         findTmpFiles(filename).forEach(tmp -> {
             try {
                 FileUtils.deleteFileIfExistsWithRetry(tmp);
-            } catch (IOException e) {
-                throw new UncheckedIOException(e);
-            }
+            } catch (IOException e) {}
         });
 
         String cp = EXPLODED_DIR.resolve("foo").resolve("classes") + File.pathSeparator +
@@ -608,17 +608,25 @@
              .assertFailure()
              .resultChecker(r -> {
                  assertContains(r.output, "unnamed package");
-                 Set<Path> tmpfiles = findTmpFiles(filename).collect(toSet());
+                 List<Path> tmpfiles = findTmpFiles(filename);
                  assertTrue(tmpfiles.isEmpty(), "Unexpected tmp file:" + tmpfiles);
              });
     }
 
-    private Stream<Path> findTmpFiles(String prefix) {
-        try {
-            Path tmpdir = Paths.get(System.getProperty("java.io.tmpdir"));
-            return Files.find(tmpdir, 1, (p, attrs) ->
-                p.getFileName().toString().startsWith(prefix)
-                    && p.getFileName().toString().endsWith(".tmp"));
+    /*
+     * Returns the list of writeable tmp files with the given prefix.
+     *
+     * Ignore the non-writeable tmp files because this test is possibly
+     * running by another user.
+     */
+    private List<Path> findTmpFiles(String prefix) {
+        Path tmpdir = Paths.get(System.getProperty("java.io.tmpdir"));
+        try (Stream<Path> stream = Files.list(tmpdir)) {
+            return stream.filter(p -> {
+                        String fn = p.getFileName().toString();
+                        return Files.isWritable(p)
+                                && fn.startsWith(prefix) && fn.endsWith(".tmp");
+                    }).collect(Collectors.toList());
         } catch (IOException e) {
             throw new UncheckedIOException(e);
         }
--- a/jdk/test/tools/pack200/Utils.java	Wed Jul 05 22:43:19 2017 +0200
+++ b/jdk/test/tools/pack200/Utils.java	Sat Jan 21 03:53:21 2017 +0000
@@ -111,6 +111,7 @@
 
         compiler("-d",
                 XCLASSES.getName(),
+                "--add-modules=jdk.jdeps",
                 "--add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED",
                 "@" + tmpFile.getAbsolutePath());